(self)
| 683 | self.assertEqual(self.text, text) |
| 684 | |
| 685 | def test_reporthook(self): |
| 686 | # Make sure that the reporthook works. |
| 687 | def hooktester(block_count, block_read_size, file_size, count_holder=[0]): |
| 688 | self.assertIsInstance(block_count, int) |
| 689 | self.assertIsInstance(block_read_size, int) |
| 690 | self.assertIsInstance(file_size, int) |
| 691 | self.assertEqual(block_count, count_holder[0]) |
| 692 | count_holder[0] = count_holder[0] + 1 |
| 693 | second_temp = "%s.2" % os_helper.TESTFN |
| 694 | self.registerFileForCleanUp(second_temp) |
| 695 | urllib.request.urlretrieve( |
| 696 | self.constructLocalFileUrl(os_helper.TESTFN), |
| 697 | second_temp, hooktester) |
| 698 | |
| 699 | def test_reporthook_0_bytes(self): |
| 700 | # Test on zero length file. Should call reporthook only 1 time. |
nothing calls this directly
no test coverage detected