mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
Use unittest specific methods for some urllib test cases. And replace urllib2 with urllib.request in comments.
This commit is contained in:
parent
1f594ad424
commit
419e384601
3 changed files with 36 additions and 37 deletions
|
@ -102,7 +102,7 @@ class urlopen_FileTests(unittest.TestCase):
|
|||
self.assertEqual(self.returned_obj.geturl(), self.pathname)
|
||||
|
||||
def test_getcode(self):
|
||||
self.assertEqual(self.returned_obj.getcode(), None)
|
||||
self.assertIsNone(self.returned_obj.getcode())
|
||||
|
||||
def test_iter(self):
|
||||
# Test iterator
|
||||
|
@ -131,7 +131,7 @@ class ProxyTests(unittest.TestCase):
|
|||
self.env.set('NO_PROXY', 'localhost')
|
||||
proxies = urllib.request.getproxies_environment()
|
||||
# getproxies_environment use lowered case truncated (no '_proxy') keys
|
||||
self.assertEquals('localhost', proxies['no'])
|
||||
self.assertEqual('localhost', proxies['no'])
|
||||
|
||||
|
||||
class urlopen_HttpTests(unittest.TestCase):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue