(self)
| 1400 | self.assertEqual(data, fobj.getvalue()) |
| 1401 | |
| 1402 | def test_eof_marker(self): |
| 1403 | # Make sure an end of archive marker is written (two zero blocks). |
| 1404 | # tarfile insists on aligning archives to a 20 * 512 byte recordsize. |
| 1405 | # So, we create an archive that has exactly 10240 bytes without the |
| 1406 | # marker, and has 20480 bytes once the marker is written. |
| 1407 | with tarfile.open(tmpname, self.mode) as tar: |
| 1408 | t = tarfile.TarInfo("foo") |
| 1409 | t.size = tarfile.RECORDSIZE - tarfile.BLOCKSIZE |
| 1410 | tar.addfile(t, io.BytesIO(b"a" * t.size)) |
| 1411 | |
| 1412 | with self.open(tmpname, "rb") as fobj: |
| 1413 | self.assertEqual(len(fobj.read()), tarfile.RECORDSIZE * 2) |
| 1414 | |
| 1415 | |
| 1416 | class WriteTest(WriteTestBase, unittest.TestCase): |
nothing calls this directly
no test coverage detected