(cls)
| 4673 | |
| 4674 | @classmethod |
| 4675 | def setUpClass(cls): |
| 4676 | p = cls.ar_with_file = os.path.join(TEMPDIR, 'tar-with-file.tar') |
| 4677 | cls.addClassCleanup(os_helper.unlink, p) |
| 4678 | with tarfile.open(p, 'w') as tar: |
| 4679 | t = tarfile.TarInfo('test') |
| 4680 | t.size = 10 |
| 4681 | tar.addfile(t, io.BytesIO(b'newcontent')) |
| 4682 | |
| 4683 | p = cls.ar_with_dir = os.path.join(TEMPDIR, 'tar-with-dir.tar') |
| 4684 | cls.addClassCleanup(os_helper.unlink, p) |
| 4685 | with tarfile.open(p, 'w') as tar: |
| 4686 | tar.addfile(tar.gettarinfo(os.curdir, 'test')) |
| 4687 | |
| 4688 | p = os.path.join(TEMPDIR, 'tar-with-implicit-dir.tar') |
| 4689 | cls.ar_with_implicit_dir = p |
| 4690 | cls.addClassCleanup(os_helper.unlink, p) |
| 4691 | with tarfile.open(p, 'w') as tar: |
| 4692 | t = tarfile.TarInfo('test/file') |
| 4693 | t.size = 10 |
| 4694 | tar.addfile(t, io.BytesIO(b'newcontent')) |
| 4695 | |
| 4696 | def open(self, path): |
| 4697 | return tarfile.open(path, 'r') |
nothing calls this directly
no test coverage detected