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

Method _test_sparse_file

Lib/test/test_tarfile.py:1252–1262  ·  view source on GitHub ↗
(self, name)

Source from the content-addressed store, hash-verified

1250 # an all platforms, and after that a test that will work only on
1251 # platforms/filesystems that prove to support sparse files.
1252 def _test_sparse_file(self, name):
1253 self.tar.extract(name, TEMPDIR, filter='data')
1254 filename = os.path.join(TEMPDIR, name)
1255 with open(filename, "rb") as fobj:
1256 data = fobj.read()
1257 self.assertEqual(sha256sum(data), sha256_sparse,
1258 "wrong sha256sum for %s" % name)
1259
1260 if self._fs_supports_holes():
1261 s = os.stat(filename)
1262 self.assertLess(s.st_blocks * 512, s.st_size)
1263
1264 def test_sparse_file_old(self):
1265 self._test_sparse_file("gnu/sparse")

Callers 4

test_sparse_file_oldMethod · 0.95
test_sparse_file_00Method · 0.95
test_sparse_file_01Method · 0.95
test_sparse_file_10Method · 0.95

Calls 9

_fs_supports_holesMethod · 0.95
sha256sumFunction · 0.85
openFunction · 0.50
extractMethod · 0.45
joinMethod · 0.45
readMethod · 0.45
assertEqualMethod · 0.45
statMethod · 0.45
assertLessMethod · 0.45

Tested by

no test coverage detected