(self)
| 697 | second_temp, hooktester) |
| 698 | |
| 699 | def test_reporthook_0_bytes(self): |
| 700 | # Test on zero length file. Should call reporthook only 1 time. |
| 701 | report = [] |
| 702 | def hooktester(block_count, block_read_size, file_size, _report=report): |
| 703 | _report.append((block_count, block_read_size, file_size)) |
| 704 | srcFileName = self.createNewTempFile() |
| 705 | urllib.request.urlretrieve(self.constructLocalFileUrl(srcFileName), |
| 706 | os_helper.TESTFN, hooktester) |
| 707 | self.assertEqual(len(report), 1) |
| 708 | self.assertEqual(report[0][2], 0) |
| 709 | |
| 710 | def test_reporthook_5_bytes(self): |
| 711 | # Test on 5 byte file. Should call reporthook only 2 times (once when |
nothing calls this directly
no test coverage detected