(pth: Path, fixtures)
| 68 | |
| 69 | |
| 70 | def create_same_files(pth: Path, fixtures): |
| 71 | filename = "wheel-0.34.2.tar.gz" |
| 72 | file_pth = fixtures.path(f"mirror/{filename}") |
| 73 | |
| 74 | assert os.path.exists(file_pth) |
| 75 | |
| 76 | struct = [] |
| 77 | |
| 78 | # Same file in the same directory (no FS changes) |
| 79 | dest1 = pth / "same_files/same_directory" / filename |
| 80 | dest1.parent.mkdir(parents=True) |
| 81 | os.symlink(src=file_pth, dst=dest1) |
| 82 | struct.append(( |
| 83 | ScanLocation(dest1.parent), |
| 84 | ScanLocation(dest1.parent), |
| 85 | dest1 |
| 86 | )) |
| 87 | |
| 88 | # File has been moved to a subdirectory |
| 89 | dest2 = pth / "same_files/sub_directory/sub_directory" / filename |
| 90 | dest2.parent.mkdir(parents=True) |
| 91 | os.symlink(src=file_pth, dst=dest2) |
| 92 | struct.append(( |
| 93 | ScanLocation(dest1.parent), |
| 94 | ScanLocation(dest2.parent.parent), |
| 95 | {"operation": "R", "a_ref": dest1.name, "b_ref": f"sub_directory/{filename}"} |
| 96 | )) |
| 97 | |
| 98 | return struct |
| 99 | |
| 100 | |
| 101 | def create_add_file(pth: Path, fixtures): |
nothing calls this directly
no test coverage detected