]> granicus.if.org Git - python/commitdiff
Fix test_urllib broken by my previous commits. The assumptions it was
authorGregory P. Smith <greg@krypto.org>
Sat, 10 Nov 2012 23:12:55 +0000 (15:12 -0800)
committerGregory P. Smith <greg@krypto.org>
Sat, 10 Nov 2012 23:12:55 +0000 (15:12 -0800)
testing were added as part of the issue10050 change that caused the
wrong behavior in the first place.  now all test cases agree on the
behavior.

Lib/test/test_urllib.py

index 623eb5ef2f948b839fb0099b86aab9e14fc9d387..52e7749d8935bde7253fd4bb498ce94b8ef15bda 100644 (file)
@@ -455,8 +455,8 @@ class urlretrieve_FileTests(unittest.TestCase):
         urllib.request.urlretrieve(self.constructLocalFileUrl(srcFileName),
             support.TESTFN, hooktester)
         self.assertEqual(len(report), 2)
-        self.assertEqual(report[0][1], 0)
-        self.assertEqual(report[1][1], 5)
+        self.assertEqual(report[0][2], 5)
+        self.assertEqual(report[1][2], 5)
 
     def test_reporthook_8193_bytes(self):
         # Test on 8193 byte file. Should call reporthook only 3 times (once
@@ -469,9 +469,10 @@ class urlretrieve_FileTests(unittest.TestCase):
         urllib.request.urlretrieve(self.constructLocalFileUrl(srcFileName),
             support.TESTFN, hooktester)
         self.assertEqual(len(report), 3)
-        self.assertEqual(report[0][1], 0)
+        self.assertEqual(report[0][2], 8193)
+        self.assertEqual(report[0][1], 8192)
         self.assertEqual(report[1][1], 8192)
-        self.assertEqual(report[2][1], 1)
+        self.assertEqual(report[2][1], 8192)
 
 
 class urlretrieve_HttpTests(unittest.TestCase, FakeHTTPMixin):