Skip to content

Commit

Permalink
Fix InputAnalyzerJob type and add regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
JuanTecedor committed Feb 17, 2025
1 parent 3dc1a88 commit 58580ab
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions tests/test_cortex_endpoint.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
from thehive4py.client import TheHiveApi
from thehive4py.types.case import OutputCase
from thehive4py.types.observable import OutputObservable


class TestCortexEndpoint:
def test_create_analyzer_job(
self, thehive: TheHiveApi, test_observable: OutputObservable
):
output_analyzer_job = thehive.cortex.create_analyzer_job(
job={
"analyzerId": "example",
"cortexId": "cortex",
"artifactId": test_observable["_id"],
}
)
assert output_analyzer_job["_type"] == "case_artifact_job"

def test_list_analyzers(self, thehive: TheHiveApi):
analyzers = thehive.cortex.list_analyzers()
assert analyzers == []
Expand Down
2 changes: 1 addition & 1 deletion thehive4py/types/cortex.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class InputResponderAction(InputResponderActionRequired, total=False):
class InputAnalyzerJobRequired(TypedDict):
analyzerId: str
cortexId: str
observableId: str
artifactId: str


class InputAnalyzerJob(InputAnalyzerJobRequired, total=False):
Expand Down

0 comments on commit 58580ab

Please sign in to comment.