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

Method test_big_chunk

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

Source from the content-addressed store, hash-verified

3304 self.assertEqual(read_file(TESTFN2, binary=True), self.FILEDATA)
3305
3306 def test_big_chunk(self):
3307 # Force internal file size detection to be +100MB bigger than
3308 # the actual file size. Make sure a system call does not rely on
3309 # file size value except for (maybe) a better throughput /
3310 # performance.
3311 mock = unittest.mock.Mock()
3312 mock.st_size = self.FILESIZE + (100 * 1024 * 1024)
3313 with unittest.mock.patch('os.fstat', return_value=mock) as m:
3314 with self.get_files() as (src, dst):
3315 self.zerocopy_fun(src, dst)
3316 assert m.called
3317 self.assertEqual(read_file(TESTFN2, binary=True), self.FILEDATA)
3318
3319 def test_blocksize_arg(self):
3320 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