MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_large_filesize

Method test_large_filesize

Lib/test/test_mmap.py:921–931  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

919 self.assertEqual(m[0xFFFFFFF], 32)
920
921 def test_large_filesize(self):
922 with self._make_test_file(0x17FFFFFFF, b" ") as f:
923 if sys.maxsize < 0x180000000:
924 # On 32 bit platforms the file is larger than sys.maxsize so
925 # mapping the whole file should fail -- Issue #16743
926 with self.assertRaises(OverflowError):
927 mmap.mmap(f.fileno(), 0x180000000, access=mmap.ACCESS_READ)
928 with self.assertRaises(ValueError):
929 mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ)
930 with mmap.mmap(f.fileno(), 0x10000, access=mmap.ACCESS_READ) as m:
931 self.assertEqual(m.size(), 0x180000000)
932
933 # Issue 11277: mmap() with large (~4 GiB) sparse files crashes on OS X.
934

Callers

nothing calls this directly

Calls 5

_make_test_fileMethod · 0.95
assertRaisesMethod · 0.45
filenoMethod · 0.45
assertEqualMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected