Tests¶
tests.conftest ¶
set_env ¶
set_env(monkeypatch)
Alias of pytest fixture for readability in tests.
Source code in tests/conftest.py
12 13 14 15 |
|
tests.test_api_storage ¶
test_save_and_get_analysis_by_sha256 ¶
test_save_and_get_analysis_by_sha256(tmp_path, monkeypatch)
Persists an analysis in a temp SQLite DB and fetches it by sha256.
Source code in tests/test_api_storage.py
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
|
tests.test_cti_analysis ¶
test_malwarebazaar_lookup_no_key ¶
test_malwarebazaar_lookup_no_key(set_env)
Forces empty MalwareBazaar key and expects an explicit error response.
Source code in tests/test_cti_analysis.py
10 11 12 13 14 |
|
test_normalize_hash_merges_labels_and_refs ¶
test_normalize_hash_merges_labels_and_refs()
Ensures normalize_hash merges labels and references from providers.
Source code in tests/test_cti_analysis.py
22 23 24 25 26 27 28 29 30 31 32 33 |
|
test_otx_query_unsupported_type_without_key ¶
test_otx_query_unsupported_type_without_key(set_env)
Uses a dummy OTX key to reach type validation and assert the error.
Source code in tests/test_cti_analysis.py
16 17 18 19 20 |
|
test_vt_lookup_no_key ¶
test_vt_lookup_no_key(set_env)
Forces empty VT key and expects an explicit error response.
Source code in tests/test_cti_analysis.py
4 5 6 7 8 |
|
tests.test_logging_config ¶
test_configure_logging_allows_debug ¶
test_configure_logging_allows_debug()
Configures logging to DEBUG and asserts the logger honors it.
Source code in tests/test_logging_config.py
5 6 7 8 9 |
|
test_log_tool_decorator_wraps_and_logs ¶
test_log_tool_decorator_wraps_and_logs(caplog)
Verifies log_tool decorates a function and emits start logs.
Source code in tests/test_logging_config.py
11 12 13 14 15 16 17 18 19 20 21 22 23 |
|
tests.test_static_analysis ¶
test_comprehensive_triage_non_pe_with_iocs ¶
test_comprehensive_triage_non_pe_with_iocs(tmp_path)
Run comprehensive triage on a small non-PE file and assert key sections.
Source code in tests/test_static_analysis.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
|
write_bytes ¶
write_bytes(tmp_path, name, data)
Helper: write bytes to a temp file and return its Path.
Source code in tests/test_static_analysis.py
5 6 7 8 9 |
|