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

Method test_link_size

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

Source from the content-addressed store, hash-verified

1518 @unittest.skipUnless(hasattr(os, "link"),
1519 "Missing hardlink implementation")
1520 def test_link_size(self):
1521 link = os.path.join(TEMPDIR, "link")
1522 target = os.path.join(TEMPDIR, "link_target")
1523 with open(target, "wb") as fobj:
1524 fobj.write(b"aaa")
1525 try:
1526 os.link(target, link)
1527 except PermissionError as e:
1528 self.skipTest('os.link(): %s' % e)
1529 try:
1530 tar = tarfile.open(tmpname, self.mode)
1531 try:
1532 # Record the link target in the inodes list.
1533 tar.gettarinfo(target)
1534 tarinfo = tar.gettarinfo(link)
1535 self.assertEqual(tarinfo.size, 0)
1536 finally:
1537 tar.close()
1538 finally:
1539 os_helper.unlink(target)
1540 os_helper.unlink(link)
1541
1542 @os_helper.skip_unless_symlink
1543 def test_symlink_size(self):

Callers

nothing calls this directly

Calls 9

skipTestMethod · 0.80
gettarinfoMethod · 0.80
openFunction · 0.50
joinMethod · 0.45
writeMethod · 0.45
openMethod · 0.45
assertEqualMethod · 0.45
closeMethod · 0.45
unlinkMethod · 0.45

Tested by

no test coverage detected