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

Method test_cant_get_size

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

Source from the content-addressed store, hash-verified

3281 self.assertEqual(cm.exception.errno, errno.EBADF)
3282
3283 def test_cant_get_size(self):
3284 # Emulate a case where src file size cannot be determined.
3285 # Internally bufsize will be set to a small value and
3286 # a system call will be called repeatedly.
3287 with unittest.mock.patch('os.fstat', side_effect=OSError) as m:
3288 with self.get_files() as (src, dst):
3289 self.zerocopy_fun(src, dst)
3290 assert m.called
3291 self.assertEqual(read_file(TESTFN2, binary=True), self.FILEDATA)
3292
3293 def test_small_chunks(self):
3294 # Force internal file size detection to be smaller than the

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