generated from Ostorlab/template_agent
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from Ostorlab/implement_process
Feat / Implement process
- Loading branch information
Showing
4 changed files
with
119 additions
and
4 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
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,6 +1,20 @@ | ||
"""Unit tests for AsteroidAgent.""" | ||
from typing import Type | ||
from agent import asteroid_agent | ||
from agent import definitions | ||
|
||
from ostorlab.agent.message import message as m | ||
|
||
def testAgent() -> None: | ||
"""Fake test.""" | ||
assert True | ||
|
||
def testAsteroidAgent_whenExploitCheckDetectVulnz_EmitsVulnerabilityReport( | ||
exploit_instance_with_report: Type[definitions.Exploit], | ||
asteroid_agent_instance: asteroid_agent.AsteroidAgent, | ||
agent_mock: list[m.Message], | ||
scan_message_domain_name: m.Message, | ||
) -> None: | ||
"""Unit test for agent AsteroidAgent exploits check. case Exploit emits vulnerability report""" | ||
|
||
asteroid_agent_instance.process(scan_message_domain_name) | ||
|
||
assert len(agent_mock) == 1 | ||
assert agent_mock[0].selector == "v3.report.vulnerability" |
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
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 |
---|---|---|
|
@@ -2,6 +2,7 @@ pylint | |
pytest | ||
black | ||
mypy | ||
pytest_mock | ||
typing-extensions | ||
requests_mock | ||
types-requests | ||
|