(self)
| 1435 | prefix = "w:" |
| 1436 | |
| 1437 | def test_100_char_name(self): |
| 1438 | # The name field in a tar header stores strings of at most 100 chars. |
| 1439 | # If a string is shorter than 100 chars it has to be padded with '\0', |
| 1440 | # which implies that a string of exactly 100 chars is stored without |
| 1441 | # a trailing '\0'. |
| 1442 | name = "0123456789" * 10 |
| 1443 | tar = tarfile.open(tmpname, self.mode) |
| 1444 | try: |
| 1445 | t = tarfile.TarInfo(name) |
| 1446 | tar.addfile(t) |
| 1447 | finally: |
| 1448 | tar.close() |
| 1449 | |
| 1450 | tar = tarfile.open(tmpname) |
| 1451 | try: |
| 1452 | self.assertEqual(tar.getnames()[0], name, |
| 1453 | "failed to store 100 char filename") |
| 1454 | finally: |
| 1455 | tar.close() |
| 1456 | |
| 1457 | def test_tar_size(self): |
| 1458 | # Test for bug #1013882. |
nothing calls this directly
no test coverage detected