(self)
| 665 | "as second returned value") |
| 666 | |
| 667 | def test_copy(self): |
| 668 | # Test that setting the filename argument works. |
| 669 | second_temp = "%s.2" % os_helper.TESTFN |
| 670 | self.registerFileForCleanUp(second_temp) |
| 671 | result = urllib.request.urlretrieve(self.constructLocalFileUrl( |
| 672 | os_helper.TESTFN), second_temp) |
| 673 | self.assertEqual(second_temp, result[0]) |
| 674 | self.assertTrue(os.path.exists(second_temp), "copy of the file was not " |
| 675 | "made") |
| 676 | FILE = open(second_temp, 'rb') |
| 677 | try: |
| 678 | text = FILE.read() |
| 679 | FILE.close() |
| 680 | finally: |
| 681 | try: FILE.close() |
| 682 | except: pass |
| 683 | self.assertEqual(self.text, text) |
| 684 | |
| 685 | def test_reporthook(self): |
| 686 | # Make sure that the reporthook works. |
nothing calls this directly
no test coverage detected