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

Method test_extract_hardlink

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

Source from the content-addressed store, hash-verified

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