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

Method test_extract_pathlike_dir

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected