(self)
| 1518 | @unittest.skipUnless(hasattr(os, "link"), |
| 1519 | "Missing hardlink implementation") |
| 1520 | def test_link_size(self): |
| 1521 | link = os.path.join(TEMPDIR, "link") |
| 1522 | target = os.path.join(TEMPDIR, "link_target") |
| 1523 | with open(target, "wb") as fobj: |
| 1524 | fobj.write(b"aaa") |
| 1525 | try: |
| 1526 | os.link(target, link) |
| 1527 | except PermissionError as e: |
| 1528 | self.skipTest('os.link(): %s' % e) |
| 1529 | try: |
| 1530 | tar = tarfile.open(tmpname, self.mode) |
| 1531 | try: |
| 1532 | # Record the link target in the inodes list. |
| 1533 | tar.gettarinfo(target) |
| 1534 | tarinfo = tar.gettarinfo(link) |
| 1535 | self.assertEqual(tarinfo.size, 0) |
| 1536 | finally: |
| 1537 | tar.close() |
| 1538 | finally: |
| 1539 | os_helper.unlink(target) |
| 1540 | os_helper.unlink(link) |
| 1541 | |
| 1542 | @os_helper.skip_unless_symlink |
| 1543 | def test_symlink_size(self): |
nothing calls this directly
no test coverage detected