Skip to content

Commit 72b4214

Browse files
committed
fixed test
1 parent fc9f1b7 commit 72b4214

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

tests/api_app/test_api.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,20 @@ def test_ask_analysis_availability__run_all_analyzers(self):
108108
self.assertEqual(response.status_code, 200)
109109

110110
def test_analyze_file__pcap(self):
111+
# set a fake API key or YARAify_File_Scan will be skipped as not configured
112+
models.PluginConfig.objects.create(
113+
owner=self.user,
114+
analyzer_config=AnalyzerConfig.objects.get(name="YARAify_File_Scan"),
115+
parameter=models.Parameter.objects.get(
116+
python_module=models.PythonModule.objects.get(
117+
base_path="api_app.analyzers_manager.file_analyzers",
118+
module="yaraify_file_scan.YARAifyFileScan",
119+
),
120+
name="service_api_key",
121+
),
122+
value="faketoken",
123+
)
124+
111125
# with noone, only the PCAP analyzers should be executed
112126
analyzers_requested = AnalyzerConfig.objects.all().values_list(
113127
"name", flat=True

0 commit comments

Comments
 (0)