(self)
| 1469 | |
| 1470 | # The test_*_size tests test for bug #1167128. |
| 1471 | def test_file_size(self): |
| 1472 | tar = tarfile.open(tmpname, self.mode) |
| 1473 | try: |
| 1474 | path = os.path.join(TEMPDIR, "file") |
| 1475 | with open(path, "wb"): |
| 1476 | pass |
| 1477 | tarinfo = tar.gettarinfo(path) |
| 1478 | self.assertEqual(tarinfo.size, 0) |
| 1479 | |
| 1480 | with open(path, "wb") as fobj: |
| 1481 | fobj.write(b"aaa") |
| 1482 | tarinfo = tar.gettarinfo(path) |
| 1483 | self.assertEqual(tarinfo.size, 3) |
| 1484 | finally: |
| 1485 | tar.close() |
| 1486 | |
| 1487 | def test_directory_size(self): |
| 1488 | path = os.path.join(TEMPDIR, "directory") |
nothing calls this directly
no test coverage detected