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

Method test_tar_size

Lib/test/test_tarfile.py:1457–1468  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1455 tar.close()
1456
1457 def test_tar_size(self):
1458 # Test for bug #1013882.
1459 tar = tarfile.open(tmpname, self.mode)
1460 try:
1461 path = os.path.join(TEMPDIR, "file")
1462 with open(path, "wb") as fobj:
1463 fobj.write(b"aaa")
1464 tar.add(path)
1465 finally:
1466 tar.close()
1467 self.assertGreater(os.path.getsize(tmpname), 0,
1468 "tarfile is empty")
1469
1470 # The test_*_size tests test for bug #1167128.
1471 def test_file_size(self):

Callers

nothing calls this directly

Calls 7

assertGreaterMethod · 0.80
openFunction · 0.50
openMethod · 0.45
joinMethod · 0.45
writeMethod · 0.45
addMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected