(self)
| 1535 | @unittest.skipUnless(hasattr(os, "link"), |
| 1536 | "Missing hardlink implementation") |
| 1537 | def test_link_size(self): |
| 1538 | link = os.path.join(TEMPDIR, "link") |
| 1539 | target = os.path.join(TEMPDIR, "link_target") |
| 1540 | with open(target, "wb") as fobj: |
| 1541 | fobj.write(b"aaa") |
| 1542 | try: |
| 1543 | os.link(target, link) |
| 1544 | except PermissionError as e: |
| 1545 | self.skipTest('os.link(): %s' % e) |
| 1546 | try: |
| 1547 | tar = tarfile.open(tmpname, self.mode) |
| 1548 | try: |
| 1549 | # Record the link target in the inodes list. |
| 1550 | tar.gettarinfo(target) |
| 1551 | tarinfo = tar.gettarinfo(link) |
| 1552 | self.assertEqual(tarinfo.size, 0) |
| 1553 | finally: |
| 1554 | tar.close() |
| 1555 | finally: |
| 1556 | os_helper.unlink(target) |
| 1557 | os_helper.unlink(link) |
| 1558 | |
| 1559 | @os_helper.skip_unless_symlink |
| 1560 | def test_symlink_size(self): |
nothing calls this directly
no test coverage detected