MCPcopy Index your code
hub / github.com/python/cpython / make_mmap_file

Method make_mmap_file

Lib/test/test_mmap.py:563–569  ·  view source on GitHub ↗
(self, f, halfsize)

Source from the content-addressed store, hash-verified

561 self.assertEqual(m[:], bytes(L))
562
563 def make_mmap_file (self, f, halfsize):
564 # Write 2 pages worth of data to the file
565 f.write (b'\0' * halfsize)
566 f.write (b'foo')
567 f.write (b'\0' * (halfsize - 3))
568 f.flush ()
569 return mmap.mmap (f.fileno(), 0)
570
571 def test_empty_file (self):
572 f = open (TESTFN, 'w+b')

Callers 1

test_offsetMethod · 0.95

Calls 3

writeMethod · 0.45
flushMethod · 0.45
filenoMethod · 0.45

Tested by

no test coverage detected