(fixtures, fuzzy_rule_match)
| 304 | |
| 305 | |
| 306 | def 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 | |
| 334 | def test_same_scan_location_is_rename(): |
nothing calls this directly
no test coverage detected