| 9 | |
| 10 | |
| 11 | def test_get_analyzers_custom(fixtures): |
| 12 | apth = fixtures.path("dummy_analyzer.py") |
| 13 | |
| 14 | analyzer_responses = [ |
| 15 | (f"{apth}:ClassAnalyzer", {"class_analyzer_response"}), |
| 16 | (f"{apth}:path_analyzer", {"path_analyzer_response"}), |
| 17 | (apth, {"class_analyzer_response", "path_analyzer_response"}) |
| 18 | ] |
| 19 | |
| 20 | for analyzer_name, expected_responses in analyzer_responses: |
| 21 | analyzers = plugins.get_analyzers([analyzer_name]) |
| 22 | responses = set() |
| 23 | for a in analyzers: |
| 24 | for r in a(): |
| 25 | assert isinstance(r, Detection), r |
| 26 | responses.add(r.detection_type) |
| 27 | |
| 28 | assert len(expected_responses-responses) == 0, responses |
| 29 | |
| 30 | |
| 31 | def test_load_entrypoint(): |