Skip to content

Commit

Permalink
Merge pull request #397 from JuanTecedor/395-Fix_Cortex_InputAnalyzer…
Browse files Browse the repository at this point in the history
…_job_type

Fix InputAnalyzerJob type and add regression test
  • Loading branch information
Kamforka authored Feb 17, 2025
2 parents 3dc1a88 + 58580ab commit 8ee2248
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 8ee2248

Please sign in to comment.