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

Method test_resize_past_pos

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

Source from the content-addressed store, hash-verified

725 self.assertEqual(mm.write(b"python"), 6)
726
727 def test_resize_past_pos(self):
728 m = mmap.mmap(-1, 8192)
729 self.addCleanup(m.close)
730 m.read(5000)
731 try:
732 m.resize(4096)
733 except SystemError:
734 self.skipTest("resizing not supported")
735 self.assertEqual(m.read(14), b'')
736 self.assertRaises(ValueError, m.read_byte)
737 self.assertRaises(ValueError, m.write_byte, 42)
738 self.assertRaises(ValueError, m.write, b'abc')
739
740 def test_concat_repeat_exception(self):
741 m = mmap.mmap(-1, 16)

Callers

nothing calls this directly

Calls 6

addCleanupMethod · 0.80
skipTestMethod · 0.80
readMethod · 0.45
resizeMethod · 0.45
assertEqualMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected