changeset: 80345:dcf9a07830a6 parent: 80343:5459cb9c5942 parent: 80344:e19a6194aee4 user: Gregory P. Smith date: Sat Nov 10 15:13:20 2012 -0800 files: Lib/test/test_urllib.py description: 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. diff -r 5459cb9c5942 -r dcf9a07830a6 Lib/test/test_urllib.py --- a/Lib/test/test_urllib.py Sat Nov 10 23:31:22 2012 +0100 +++ b/Lib/test/test_urllib.py Sat Nov 10 15:13:20 2012 -0800 @@ -457,8 +457,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 @@ -471,9 +471,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):

AltStyle によって変換されたページ (->オリジナル) /