(self)
| 1438 | tar.close() |
| 1439 | |
| 1440 | def test_tar_size(self): |
| 1441 | # Test for bug #1013882. |
| 1442 | tar = tarfile.open(tmpname, self.mode) |
| 1443 | try: |
| 1444 | path = os.path.join(TEMPDIR, "file") |
| 1445 | with open(path, "wb") as fobj: |
| 1446 | fobj.write(b"aaa") |
| 1447 | tar.add(path) |
| 1448 | finally: |
| 1449 | tar.close() |
| 1450 | self.assertGreater(os.path.getsize(tmpname), 0, |
| 1451 | "tarfile is empty") |
| 1452 | |
| 1453 | # The test_*_size tests test for bug #1167128. |
| 1454 | def test_file_size(self): |