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

Method test_big_chunk

Lib/test/test_shutil.py:3332–3343  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3330 self.assertEqual(read_file(TESTFN2, binary=True), self.FILEDATA)
3331
3332 def test_big_chunk(self):
3333 # Force internal file size detection to be +100MB bigger than
3334 # the actual file size. Make sure a system call does not rely on
3335 # file size value except for (maybe) a better throughput /
3336 # performance.
3337 mock = unittest.mock.Mock()
3338 mock.st_size = self.FILESIZE + (100 * 1024 * 1024)
3339 with unittest.mock.patch('os.fstat', return_value=mock) as m:
3340 with self.get_files() as (src, dst):
3341 self.zerocopy_fun(src, dst)
3342 assert m.called
3343 self.assertEqual(read_file(TESTFN2, binary=True), self.FILEDATA)
3344
3345 def test_blocksize_arg(self):
3346 with unittest.mock.patch(self.PATCHPOINT,

Callers

nothing calls this directly

Calls 4

read_fileFunction · 0.85
get_filesMethod · 0.45
zerocopy_funMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected