(self)
| 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 | |
| 1239 | class GNUReadTest(LongnameTest, ReadTest, unittest.TestCase): |
| 1240 |
nothing calls this directly
no test coverage detected