MCPcopy Create free account
hub / github.com/SourceCode-AI/aura / create_same_files

Function create_same_files

tests/test_diff.py:70–98  ·  view source on GitHub ↗
(pth: Path, fixtures)

Source from the content-addressed store, hash-verified

68
69
70def 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
101def create_add_file(pth: Path, fixtures):

Callers

nothing calls this directly

Calls 3

ScanLocationClass · 0.90
pathMethod · 0.80
existsMethod · 0.45

Tested by

no test coverage detected