-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
5 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,18 @@ | ||
from thehive4py.client import TheHiveApi | ||
|
||
from thehive4py.types.case import OutputCase | ||
|
||
class TestCortexEndpoint: | ||
def test_list_analyzers(self, thehive: TheHiveApi): | ||
analyzers = thehive.cortex.list_analyzers() | ||
assert isinstance(analyzers, list) | ||
for analyzer in analyzers: | ||
assert "name" in analyzer.keys() | ||
assert "id" in analyzer.keys() | ||
assert analyzers == [] | ||
|
||
def test_list_analyzers_by_type(self, thehive: TheHiveApi): | ||
data_type = "mail" | ||
analyzers = thehive.cortex.list_analyzers_by_type(data_type=data_type) | ||
assert isinstance(analyzers, list) | ||
for analyzer in analyzers: | ||
assert "name" in analyzer.keys() | ||
assert "id" in analyzer.keys() | ||
|
||
def test_list_and_get_analyzers(self, thehive: TheHiveApi): | ||
analyzers = thehive.cortex.list_analyzers() | ||
for analyzer in analyzers: | ||
_analyzer = thehive.cortex.get_analyzer(analyzer["id"]) | ||
assert _analyzer == analyzer | ||
assert analyzers == [] | ||
|
||
def test_list_responders(self, thehive: TheHiveApi): | ||
thehive.case.create(case={"title": "my first case", "description": "..."}) | ||
entity_type = "case" | ||
entity_id = thehive.case.find()[0]["_id"] | ||
def test_list_responders(self, thehive: TheHiveApi, test_case: OutputCase): | ||
responders = thehive.cortex.list_responders( | ||
entity_type=entity_type, entity_id=entity_id | ||
entity_type="case", entity_id=test_case["_id"] | ||
) | ||
assert isinstance(responders, list) | ||
for responder in responders: | ||
assert "name" in responder.keys() | ||
assert "id" in responder.keys() |