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

Method test_extract_hardlink

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

Source from the content-addressed store, hash-verified

691 "Missing hardlink implementation")
692 @os_helper.skip_unless_symlink
693 def test_extract_hardlink(self):
694 # Test hardlink extraction (e.g. bug #857297).
695 with tarfile.open(tarname, errorlevel=1, encoding="iso8859-1") as tar:
696 tar.extract("ustar/regtype", TEMPDIR, filter='data')
697 self.addCleanup(os_helper.unlink, os.path.join(TEMPDIR, "ustar/regtype"))
698
699 tar.extract("ustar/lnktype", TEMPDIR, filter='data')
700 self.addCleanup(os_helper.unlink, os.path.join(TEMPDIR, "ustar/lnktype"))
701 with open(os.path.join(TEMPDIR, "ustar/lnktype"), "rb") as f:
702 data = f.read()
703 self.assertEqual(sha256sum(data), sha256_regtype)
704
705 tar.extract("ustar/symtype", TEMPDIR, filter='data')
706 self.addCleanup(os_helper.unlink, os.path.join(TEMPDIR, "ustar/symtype"))
707 with open(os.path.join(TEMPDIR, "ustar/symtype"), "rb") as f:
708 data = f.read()
709 self.assertEqual(sha256sum(data), sha256_regtype)
710
711 @os_helper.skip_unless_working_chmod
712 def test_extractall(self):

Callers

nothing calls this directly

Calls 8

sha256sumFunction · 0.85
addCleanupMethod · 0.80
openFunction · 0.50
openMethod · 0.45
extractMethod · 0.45
joinMethod · 0.45
readMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected