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

Method _test_sparse_file

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

Source from the content-addressed store, hash-verified

1267 # an all platforms, and after that a test that will work only on
1268 # platforms/filesystems that prove to support sparse files.
1269 def _test_sparse_file(self, name):
1270 self.tar.extract(name, TEMPDIR, filter='data')
1271 filename = os.path.join(TEMPDIR, name)
1272 with open(filename, "rb") as fobj:
1273 data = fobj.read()
1274 self.assertEqual(sha256sum(data), sha256_sparse,
1275 "wrong sha256sum for %s" % name)
1276
1277 if self._fs_supports_holes():
1278 s = os.stat(filename)
1279 self.assertLess(s.st_blocks * 512, s.st_size)
1280
1281 def test_sparse_file_old(self):
1282 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