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

Method test_directory_size

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

Source from the content-addressed store, hash-verified

1485 tar.close()
1486
1487 def test_directory_size(self):
1488 path = os.path.join(TEMPDIR, "directory")
1489 os.mkdir(path)
1490 try:
1491 tar = tarfile.open(tmpname, self.mode)
1492 try:
1493 tarinfo = tar.gettarinfo(path)
1494 self.assertEqual(tarinfo.size, 0)
1495 finally:
1496 tar.close()
1497 finally:
1498 os_helper.rmdir(path)
1499
1500 # mock the following:
1501 # os.listdir: so we know that files are in the wrong order

Callers

nothing calls this directly

Calls 7

gettarinfoMethod · 0.80
rmdirMethod · 0.80
joinMethod · 0.45
mkdirMethod · 0.45
openMethod · 0.45
assertEqualMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected