(mock1, fixtures)
| 422 | |
| 423 | @mock.patch("aura.analyzers.archive.archive_analyzer") |
| 424 | def 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 | |
| 453 | def test_closure_archive_files(fixtures): |
nothing calls this directly
no test coverage detected