MCPcopy Index your code
hub / github.com/SourceCode-AI/aura / test_diff_archives

Function test_diff_archives

tests/test_diff.py:306–331  ·  view source on GitHub ↗
(fixtures, fuzzy_rule_match)

Source from the content-addressed store, hash-verified

304
305
306def test_diff_archives(fixtures, fuzzy_rule_match):
307 arch1 = fixtures.path("mirror/wheel-0.34.2-py2.py3-none-any.whl")
308 arch2 = fixtures.path("mirror/wheel-0.34.2.tar.gz")
309 matches = [
310 {
311 "a_md5": "8a2e3b6aca9665a0c6abecc4f4ea7090",
312 "a_mime": "application/zip",
313 "a_ref": "mirror/wheel-0.34.2-py2.py3-none-any.whl",
314 "b_md5": "ce2a27f99c130a927237b5da1ff5ceaf",
315 "b_mime": "application/gzip",
316 "b_ref": "mirror/wheel-0.34.2.tar.gz",
317 "diff": None,
318 "operation": "M"
319 }
320 ]
321
322 d = diff.DiffAnalyzer()
323 d.compare(
324 ScanLocation(arch1, strip_path=os.fspath(fixtures.BASE_PATH)),
325 ScanLocation(arch2, strip_path=os.fspath(fixtures.BASE_PATH)),
326 )
327
328 diffs = [x.as_dict() for x in d.diffs]
329
330 for match in matches:
331 assert any(fuzzy_rule_match(x, match) for x in diffs), (match, diffs)
332
333
334def test_same_scan_location_is_rename():

Callers

nothing calls this directly

Calls 5

compareMethod · 0.95
ScanLocationClass · 0.90
fuzzy_rule_matchFunction · 0.85
pathMethod · 0.80
as_dictMethod · 0.80

Tested by

no test coverage detected