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

Method test_extract_pathlike_dir

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

Source from the content-addressed store, hash-verified

783 self.assertEqual(os.path.getmtime(path), tarinfo.mtime)
784
785 def test_extract_pathlike_dir(self):
786 dirtype = "ustar/dirtype"
787 DIR = os.path.join(TEMPDIR, "extractall")
788 with os_helper.temp_dir(DIR), \
789 tarfile.open(tarname, encoding="iso8859-1") as tar:
790 tarinfo = tar.getmember(dirtype)
791 tar.extract(tarinfo, path=os_helper.FakePath(DIR), filter='fully_trusted')
792 extracted = os.path.join(DIR, dirtype)
793 self.assertEqual(os.path.getmtime(extracted), tarinfo.mtime)
794
795 def test_init_close_fobj(self):
796 # Issue #7341: Close the internal file object in the TarFile

Callers

nothing calls this directly

Calls 6

temp_dirMethod · 0.80
getmemberMethod · 0.80
joinMethod · 0.45
openMethod · 0.45
extractMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected