[Python-checkins] cpython (3.3): Fix test_urllib broken by my previous commits. The assumptions it was

gregory.p.smith python-checkins at python.org
Sun Nov 11 00:13:37 CET 2012


http://hg.python.org/cpython/rev/e19a6194aee4
changeset:   80344:e19a6194aee4
branch:      3.3
parent:      80342:2f35cdd1497b
user:        Gregory P. Smith <greg at krypto.org>
date:        Sat Nov 10 15:12:55 2012 -0800
summary:
  Fix test_urllib broken by my previous commits.  The assumptions it was
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.

files:
  Lib/test/test_urllib.py |  9 +++++----
  1 files changed, 5 insertions(+), 4 deletions(-)


diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py
--- a/Lib/test/test_urllib.py
+++ b/Lib/test/test_urllib.py
@@ -455,8 +455,8 @@
         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 @@
         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):

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list