(fixtures, tmp_path)
| 226 | |
| 227 | |
| 228 | def test_diff_same_renamed(fixtures, tmp_path): |
| 229 | orig_pth = fixtures.path("diffs/1_a/src.py") |
| 230 | a_pth = tmp_path / "a.py" |
| 231 | os.symlink(src=orig_pth, dst=a_pth) |
| 232 | b_pth = tmp_path / "b.py" |
| 233 | os.symlink(src=orig_pth, dst=b_pth) |
| 234 | |
| 235 | a_loc = ScanLocation(a_pth, strip_path=str(tmp_path)) |
| 236 | b_loc = ScanLocation(b_pth, strip_path=str(tmp_path)) |
| 237 | |
| 238 | d = diff.DiffAnalyzer() |
| 239 | d.compare(a_loc, b_loc) |
| 240 | |
| 241 | assert len(d.diffs) == 1 |
| 242 | x = d.diffs[0] |
| 243 | |
| 244 | assert x.operation == "M" |
| 245 | assert x.a_scan is a_loc |
| 246 | assert x.b_scan is b_loc |
| 247 | assert x.similarity == 1.0 |
| 248 | assert x.diff is None |
| 249 | |
| 250 | |
| 251 | def test_diff_file_added(fixtures): |
nothing calls this directly
no test coverage detected