mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Merged fix for #13211 from 3.2
This commit is contained in:
commit
0612e8c2a2
2 changed files with 17 additions and 0 deletions
|
@ -1449,6 +1449,17 @@ class RequestTests(unittest.TestCase):
|
|||
req = Request(url)
|
||||
self.assertEqual(req.get_full_url(), url)
|
||||
|
||||
def test_HTTPError_interface():
|
||||
"""
|
||||
Issue 13211 reveals that HTTPError didn't implement the URLError
|
||||
interface even though HTTPError is a subclass of URLError.
|
||||
|
||||
>>> err = urllib.error.HTTPError(msg='something bad happened', url=None, code=None, hdrs=None, fp=None)
|
||||
>>> assert hasattr(err, 'reason')
|
||||
>>> err.reason
|
||||
'something bad happened'
|
||||
"""
|
||||
|
||||
def test_main(verbose=None):
|
||||
from test import test_urllib2
|
||||
support.run_doctest(test_urllib2, verbose)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue