Skip to content

Commit

Permalink
Fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ohachimOs committed Sep 5, 2024
1 parent e6e7cba commit dad7469
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions tests/nmap_agent_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1297,16 +1297,16 @@ def testAgentLifecycle_whenDomainTCPWrappedService_emitsNoService(
assert len(agent_mock) == 0


def testAgentNmapOptions_whenServiceHasNoProduct_reportsFingerprintzzz(
def testAgentNmapOptions_whenServiceHasNoProduct_reportsFingerprint(
nmap_test_agent: nmap_agent.NmapAgent,
agent_mock: List[message.Message],
agent_persist_mock: Dict[Union[str, bytes], Union[str, bytes]],
domain_msg: message.Message,
mocker: plugin.MockerFixture,
fake_output_product: None | Dict[str, str],
) -> None:
"""Unittest for the full life cycle of the agent : case where the nmap scan runs without errors,
the agents emits back messages of type service with banner.
"""In case service in the scan results does not have a product field,
emit nothing instead of emitting blank entry.
"""
mocker.patch(
"agent.nmap_wrapper.NmapWrapper.scan_domain",
Expand All @@ -1318,16 +1318,15 @@ def testAgentNmapOptions_whenServiceHasNoProduct_reportsFingerprintzzz(
assert any("fingerprint" in msg.selector for msg in agent_mock) is False


def testAgentNmapOptions_whensssNmaprunHostIsList_noCrash(
def testAgentNmapOptions_whenNmaprunHostIsList_noCrash(
nmap_test_agent: nmap_agent.NmapAgent,
agent_mock: List[message.Message],
agent_persist_mock: Dict[Union[str, bytes], Union[str, bytes]],
domain_msg: message.Message,
mocker: plugin.MockerFixture,
) -> None:
"""Unittest for the full life cycle of the agent : case where the nmap scan runs without errors,
the agents emits back messages of type service with banner.
"""
"""Test host in scan results is a list instead of a dict, the agent should not
crash, instead it completes its emitting process for each of the hosts in the host list."""
mocker.patch(
"agent.nmap_wrapper.NmapWrapper.scan_domain",
return_value=(SCAN_RESULT_HOST_AS_LIST, HUMAN_OUTPUT),
Expand Down

0 comments on commit dad7469

Please sign in to comment.