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

Method test_gettarinfo_pathlike_name

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

Source from the content-addressed store, hash-verified

1505 os_helper.rmdir(path)
1506
1507 def test_gettarinfo_pathlike_name(self):
1508 with tarfile.open(tmpname, self.mode) as tar:
1509 path = os.path.join(TEMPDIR, "file")
1510 with open(path, "wb") as fobj:
1511 fobj.write(b"aaa")
1512 tarinfo = tar.gettarinfo(os_helper.FakePath(path))
1513 tarinfo2 = tar.gettarinfo(path)
1514 self.assertIsInstance(tarinfo.name, str)
1515 self.assertEqual(tarinfo.name, tarinfo2.name)
1516 self.assertEqual(tarinfo.size, 3)
1517
1518 @unittest.skipUnless(hasattr(os, "link"),
1519 "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