Back to index

python3.2  3.2.2
Public Member Functions | Private Member Functions
test.test_mmap.LargeMmapTests Class Reference

List of all members.

Public Member Functions

def setUp
def tearDown
def test_large_offset
def test_large_filesize
def test_around_2GB
def test_around_4GB

Private Member Functions

def _make_test_file
def _test_around_boundary

Detailed Description

Definition at line 658 of file test_mmap.py.


Member Function Documentation

def test.test_mmap.LargeMmapTests._make_test_file (   self,
  num_zeroes,
  tail 
) [private]

Definition at line 666 of file test_mmap.py.

00666 
00667     def _make_test_file(self, num_zeroes, tail):
00668         if sys.platform[:3] == 'win' or sys.platform == 'darwin':
00669             requires('largefile',
00670                 'test requires %s bytes and a long time to run' % str(0x180000000))
00671         f = open(TESTFN, 'w+b')
00672         try:
00673             f.seek(num_zeroes)
00674             f.write(tail)
00675             f.flush()
00676         except (IOError, OverflowError):
00677             f.close()
00678             raise unittest.SkipTest("filesystem does not have largefile support")
00679         return f

Here is the call graph for this function:

Here is the caller graph for this function:

def test.test_mmap.LargeMmapTests._test_around_boundary (   self,
  boundary 
) [private]

Definition at line 692 of file test_mmap.py.

00692 
00693     def _test_around_boundary(self, boundary):
00694         tail = b'  DEARdear  '
00695         start = boundary - len(tail) // 2
00696         end = start + len(tail)
00697         with self._make_test_file(start, tail) as f:
00698             with mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ) as m:
00699                 self.assertEqual(m[start:end], tail)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 660 of file test_mmap.py.

00660 
00661     def setUp(self):
00662         unlink(TESTFN)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 663 of file test_mmap.py.

00663 
00664     def tearDown(self):
00665         unlink(TESTFN)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 701 of file test_mmap.py.

00701 
00702     def test_around_2GB(self):
00703         self._test_around_boundary(_2G)

Here is the call graph for this function:

Definition at line 705 of file test_mmap.py.

00705 
00706     def test_around_4GB(self):
00707         self._test_around_boundary(_4G)
00708 

Here is the call graph for this function:

Definition at line 685 of file test_mmap.py.

00685 
00686     def test_large_filesize(self):
00687         with self._make_test_file(0x17FFFFFFF, b" ") as f:
00688             with mmap.mmap(f.fileno(), 0x10000, access=mmap.ACCESS_READ) as m:
00689                 self.assertEqual(m.size(), 0x180000000)

Here is the call graph for this function:

Definition at line 680 of file test_mmap.py.

00680 
00681     def test_large_offset(self):
00682         with self._make_test_file(0x14FFFFFFF, b" ") as f:
00683             with mmap.mmap(f.fileno(), 0, offset=0x140000000, access=mmap.ACCESS_READ) as m:
00684                 self.assertEqual(m[0xFFFFFFF], 32)

Here is the call graph for this function:


The documentation for this class was generated from the following file: