(self, num_zeroes, tail)
| 897 | unlink(TESTFN) |
| 898 | |
| 899 | def _make_test_file(self, num_zeroes, tail): |
| 900 | if sys.platform[:3] == 'win' or sys.platform == 'darwin': |
| 901 | requires('largefile', |
| 902 | 'test requires %s bytes and a long time to run' % str(0x180000000)) |
| 903 | f = open(TESTFN, 'w+b') |
| 904 | try: |
| 905 | f.seek(num_zeroes) |
| 906 | f.write(tail) |
| 907 | f.flush() |
| 908 | except (OSError, OverflowError, ValueError): |
| 909 | try: |
| 910 | f.close() |
| 911 | except (OSError, OverflowError): |
| 912 | pass |
| 913 | raise unittest.SkipTest("filesystem does not have largefile support") |
| 914 | return f |
| 915 | |
| 916 | def test_large_offset(self): |
| 917 | with self._make_test_file(0x14FFFFFFF, b" ") as f: |
no test coverage detected