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

Function test_archive_diff_hook

tests/test_diff.py:424–450  ·  view source on GitHub ↗
(mock1, fixtures)

Source from the content-addressed store, hash-verified

422
423@mock.patch("aura.analyzers.archive.archive_analyzer")
424def test_archive_diff_hook(mock1, fixtures):
425 from aura.analyzers.archive import diff_archive
426
427 extract_loc1 = ScanLocation("blabla_location1")
428 extract_loc2 = ScanLocation("blabla_location2")
429 mock1.side_effect = [[extract_loc1], [extract_loc2]]
430 assert extract_loc1.metadata.get("b_scan_location") != extract_loc2
431
432 arch1 = fixtures.path("mirror/wheel-0.33.0-py2.py3-none-any.whl")
433 arch2 = fixtures.path("mirror/wheel-0.34.2-py2.py3-none-any.whl")
434
435 loc1 = ScanLocation(arch1)
436 loc2 = ScanLocation(arch2)
437
438 d = diff.Diff(
439 operation="M",
440 a_scan=loc1,
441 b_scan=loc2
442 )
443
444 result = list(diff_archive(d))
445
446 mock1.assert_any_call(location=d.a_scan)
447 mock1.assert_any_call(location=d.b_scan)
448 assert len(result) == 1
449 assert result[0] == extract_loc1
450 assert result[0].metadata["b_scan_location"] == extract_loc2
451
452
453def test_closure_archive_files(fixtures):

Callers

nothing calls this directly

Calls 4

ScanLocationClass · 0.90
diff_archiveFunction · 0.90
getMethod · 0.80
pathMethod · 0.80

Tested by

no test coverage detected