Use unittest specific methods for some urllib test cases. And replace urllib2 with urllib.request in comments.

This commit is contained in:
Florent Xicluna 2010-08-08 16:16:07 +00:00
parent 1f594ad424
commit 419e384601
3 changed files with 36 additions and 37 deletions

View file

@ -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):