(self)
| 1455 | tar.close() |
| 1456 | |
| 1457 | def test_tar_size(self): |
| 1458 | # Test for bug #1013882. |
| 1459 | tar = tarfile.open(tmpname, self.mode) |
| 1460 | try: |
| 1461 | path = os.path.join(TEMPDIR, "file") |
| 1462 | with open(path, "wb") as fobj: |
| 1463 | fobj.write(b"aaa") |
| 1464 | tar.add(path) |
| 1465 | finally: |
| 1466 | tar.close() |
| 1467 | self.assertGreater(os.path.getsize(tmpname), 0, |
| 1468 | "tarfile is empty") |
| 1469 | |
| 1470 | # The test_*_size tests test for bug #1167128. |
| 1471 | def test_file_size(self): |