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

Method test_cant_get_size

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

Source from the content-addressed store, hash-verified

3307 self.assertEqual(cm.exception.errno, errno.EBADF)
3308
3309 def test_cant_get_size(self):
3310 # Emulate a case where src file size cannot be determined.
3311 # Internally bufsize will be set to a small value and
3312 # a system call will be called repeatedly.
3313 with unittest.mock.patch('os.fstat', side_effect=OSError) 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_small_chunks(self):
3320 # 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