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

Method test_truncated_longname

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

Source from the content-addressed store, hash-verified

1202 self.assertEqual(tarinfo.linkname, longname, "linkname wrong")
1203
1204 def test_truncated_longname(self):
1205 longname = self.subdir + "/" + "123/" * 125 + "longname"
1206 tarinfo = self.tar.getmember(longname)
1207 offset = tarinfo.offset
1208 self.tar.fileobj.seek(offset)
1209 fobj = io.BytesIO(self.tar.fileobj.read(3 * 512))
1210 with self.assertRaises(tarfile.ReadError):
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

Callers

nothing calls this directly

Calls 5

getmemberMethod · 0.80
seekMethod · 0.45
readMethod · 0.45
assertRaisesMethod · 0.45
openMethod · 0.45

Tested by

no test coverage detected