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

Method test_gettarinfo_pathlike_name

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

Source from the content-addressed store, hash-verified

1522 os_helper.rmdir(path)
1523
1524 def test_gettarinfo_pathlike_name(self):
1525 with tarfile.open(tmpname, self.mode) as tar:
1526 path = os.path.join(TEMPDIR, "file")
1527 with open(path, "wb") as fobj:
1528 fobj.write(b"aaa")
1529 tarinfo = tar.gettarinfo(os_helper.FakePath(path))
1530 tarinfo2 = tar.gettarinfo(path)
1531 self.assertIsInstance(tarinfo.name, str)
1532 self.assertEqual(tarinfo.name, tarinfo2.name)
1533 self.assertEqual(tarinfo.size, 3)
1534
1535 @unittest.skipUnless(hasattr(os, "link"),
1536 "Missing hardlink implementation")

Callers

nothing calls this directly

Calls 7

gettarinfoMethod · 0.80
assertIsInstanceMethod · 0.80
openFunction · 0.50
openMethod · 0.45
joinMethod · 0.45
writeMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected