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

Method test_truncated_longname

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

Source from the content-addressed store, hash-verified

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