'Issue 13211 reveals that HTTPError didn\'t implement the URLError
interface even though HTTPError is a subclass of URLError.'

def test_HTTPError_interface(self):

    msg = 'something    bad    happened'
    url = code = fp = None
    hdrs = 'Content-Length:    42'
    err = urllib.error.HTTPError(url, code, msg, hdrs, fp)
    self.assertTrue(hasattr(err, 'reason'))
    self.assertEqual(err.reason, 'something    bad    happened')
    self.assertTrue(hasattr(err, 'headers'))
    self.assertEqual(err.headers, 'Content-Length:    42')
    expected_errmsg = ('HTTP    Error    %s:    %s' % (err.code, err.msg))
    self.assertEqual(str(err), expected_errmsg)
