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

Function test_diff_file_similar

tests/test_diff.py:282–303  ·  view source on GitHub ↗
(fixtures)

Source from the content-addressed store, hash-verified

280
281
282def test_diff_file_similar(fixtures):
283 a_loc = ScanLocation(fixtures.path("diffs/1_a/src.py"))
284 b_loc = ScanLocation(fixtures.path("diffs/1_b/src.py"))
285
286 d = diff.DiffAnalyzer()
287 d.compare(a_loc, b_loc)
288
289 assert len(d.diffs) == 1
290 x = d.diffs[0]
291
292 assert x.operation == "M"
293 assert x.a_scan is a_loc
294 assert x.b_scan is b_loc
295 assert x.similarity > 0.8 and x.similarity < 1.0
296 assert x.diff is not None
297
298 assert "+import b_import" in x.diff
299 assert "-import a_import" in x.diff
300 assert " import unchanged" in x.diff
301 assert '-eval("a")' in x.diff
302 assert '+eval("b")' in x.diff
303 assert ' eval("same")' in x.diff
304
305
306def test_diff_archives(fixtures, fuzzy_rule_match):

Callers

nothing calls this directly

Calls 3

compareMethod · 0.95
ScanLocationClass · 0.90
pathMethod · 0.80

Tested by

no test coverage detected