diff options
author | Senthil Kumaran <senthil@uthcode.com> | 2013-03-19 23:46:34 (GMT) |
---|---|---|
committer | Senthil Kumaran <senthil@uthcode.com> | 2013-03-19 23:46:34 (GMT) |
commit | f47e77f3437948992c0c9e0cdca481d59ebc14fa (patch) | |
tree | 9ac0cbce224c3faaaea82c90663b55282d1b498b | |
parent | 5cfbde0e8bc6e6c8857a5ffe5c2fd20fda398406 (diff) | |
parent | 2a4d24510ad120b492afd63e60a6f8060556897c (diff) | |
download | cpython-f47e77f3437948992c0c9e0cdca481d59ebc14fa.zip cpython-f47e77f3437948992c0c9e0cdca481d59ebc14fa.tar.gz cpython-f47e77f3437948992c0c9e0cdca481d59ebc14fa.tar.bz2 |
#17471 - merge from 3.2
-rw-r--r-- | Lib/test/test_urllib2.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/test/test_urllib2.py b/Lib/test/test_urllib2.py index 3377cff..01f4dc4 100644 --- a/Lib/test/test_urllib2.py +++ b/Lib/test/test_urllib2.py @@ -1504,11 +1504,17 @@ class RequestTests(unittest.TestCase): interface even though HTTPError is a subclass of URLError. >>> msg = 'something bad happened' - >>> url = code = hdrs = fp = None + >>> url = code = fp = None + >>> hdrs = 'Content-Length: 42' >>> err = urllib.error.HTTPError(url, code, msg, hdrs, fp) >>> assert hasattr(err, 'reason') >>> err.reason 'something bad happened' + >>> assert hasattr(err, 'hdrs') + >>> err.hdrs + 'Content-Length: 42' + >>> expected_errmsg = 'HTTP Error %s: %s' % (err.code, err.msg) + >>> assert str(err) == expected_errmsg """ def test_HTTPError_interface_call(self): |