(cls)
| 4639 | |
| 4640 | @classmethod |
| 4641 | def setUpClass(cls): |
| 4642 | p = cls.ar_with_file = os.path.join(TEMPDIR, 'tar-with-file.tar') |
| 4643 | cls.addClassCleanup(os_helper.unlink, p) |
| 4644 | with tarfile.open(p, 'w') as tar: |
| 4645 | t = tarfile.TarInfo('test') |
| 4646 | t.size = 10 |
| 4647 | tar.addfile(t, io.BytesIO(b'newcontent')) |
| 4648 | |
| 4649 | p = cls.ar_with_dir = os.path.join(TEMPDIR, 'tar-with-dir.tar') |
| 4650 | cls.addClassCleanup(os_helper.unlink, p) |
| 4651 | with tarfile.open(p, 'w') as tar: |
| 4652 | tar.addfile(tar.gettarinfo(os.curdir, 'test')) |
| 4653 | |
| 4654 | p = os.path.join(TEMPDIR, 'tar-with-implicit-dir.tar') |
| 4655 | cls.ar_with_implicit_dir = p |
| 4656 | cls.addClassCleanup(os_helper.unlink, p) |
| 4657 | with tarfile.open(p, 'w') as tar: |
| 4658 | t = tarfile.TarInfo('test/file') |
| 4659 | t.size = 10 |
| 4660 | tar.addfile(t, io.BytesIO(b'newcontent')) |
| 4661 | |
| 4662 | def open(self, path): |
| 4663 | return tarfile.open(path, 'r') |
nothing calls this directly
no test coverage detected