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

Method test_header_offset

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

Source from the content-addressed store, hash-verified

1211 tarfile.open(name="foo.tar", fileobj=fobj)
1212
1213 def test_header_offset(self):
1214 # Test if the start offset of the TarInfo object includes
1215 # the preceding extended header.
1216 longname = self.subdir + "/" + "123/" * 125 + "longname"
1217 offset = self.tar.getmember(longname).offset
1218 with open(tarname, "rb") as fobj:
1219 fobj.seek(offset)
1220 tarinfo = tarfile.TarInfo.frombuf(fobj.read(512),
1221 "iso8859-1", "strict")
1222 self.assertEqual(tarinfo.type, self.longnametype)
1223
1224 def test_longname_directory(self):
1225 # Test reading a longlink directory. Issue #47231.

Callers

nothing calls this directly

Calls 6

getmemberMethod · 0.80
frombufMethod · 0.80
openFunction · 0.50
seekMethod · 0.45
readMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected