This test verifies that extracting a hardlink will not follow an existing symlink after a FileExistsError on os.link.
(self)
| 861 | ) |
| 862 | @os_helper.skip_unless_symlink |
| 863 | def test_extract_hardlink_on_symlink(self): |
| 864 | """ |
| 865 | This test verifies that extracting a hardlink will not follow an |
| 866 | existing symlink after a FileExistsError on os.link. |
| 867 | """ |
| 868 | with os_helper.temp_dir() as DIR: |
| 869 | target_filepath, hardlink_filepath = self._setup_symlink_to_target(DIR) |
| 870 | with tarfile.open(tarname, encoding="iso8859-1") as tar: |
| 871 | tar.extract("ustar/regtype", DIR, filter="data") |
| 872 | tar.extract("ustar/lnktype", DIR, filter="data") |
| 873 | self._assert_on_file_content(target_filepath, sha256sum(b"target")) |
| 874 | self._assert_on_file_content(hardlink_filepath, sha256_regtype) |
| 875 | |
| 876 | @unittest.skipUnless( |
| 877 | hasattr(os, "link"), "Missing hardlink implementation" |
nothing calls this directly
no test coverage detected