[Python-checkins] cpython (merge 3.2 -> 3.3): #17471 - merge from 3.2
senthil.kumaran
python-checkins at python.org
Wed Mar 20 00:49:29 CET 2013
http://hg.python.org/cpython/rev/8e9cf147fbca
changeset: 82809:8e9cf147fbca
branch: 3.3
parent: 82805:152e2d009098
parent: 82808:ae9aea1b3546
user: Senthil Kumaran <senthil at uthcode.com>
date: Tue Mar 19 16:46:34 2013 -0700
summary:
#17471 - merge from 3.2
files:
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
--- a/Lib/test/test_urllib2.py
+++ b/Lib/test/test_urllib2.py
@@ -1504,11 +1504,17 @@
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):
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list