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

Method test_longname_directory

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

Source from the content-addressed store, hash-verified

1222 self.assertEqual(tarinfo.type, self.longnametype)
1223
1224 def test_longname_directory(self):
1225 # Test reading a longlink directory. Issue #47231.
1226 longdir = ('a' * 101) + '/'
1227 with os_helper.temp_cwd():
1228 with tarfile.open(tmpname, 'w') as tar:
1229 tar.format = self.format
1230 try:
1231 os.mkdir(longdir)
1232 tar.add(longdir)
1233 finally:
1234 os.rmdir(longdir.rstrip("/"))
1235 with tarfile.open(tmpname) as tar:
1236 self.assertIsNotNone(tar.getmember(longdir))
1237 self.assertIsNotNone(tar.getmember(longdir.removesuffix('/')))
1238
1239class GNUReadTest(LongnameTest, ReadTest, unittest.TestCase):
1240

Callers

nothing calls this directly

Calls 8

rmdirMethod · 0.80
assertIsNotNoneMethod · 0.80
getmemberMethod · 0.80
openMethod · 0.45
mkdirMethod · 0.45
addMethod · 0.45
rstripMethod · 0.45
removesuffixMethod · 0.45

Tested by

no test coverage detected