From ad55c2eb0919ba9e3b44ac07281d97954edfb930 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 12 Aug 2024 16:46:22 -0400 Subject: [PATCH] comment tests --- bbot/test/test_step_1/test_events.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bbot/test/test_step_1/test_events.py b/bbot/test/test_step_1/test_events.py index 83f2bf78b..481feb744 100644 --- a/bbot/test/test_step_1/test_events.py +++ b/bbot/test/test_step_1/test_events.py @@ -775,22 +775,26 @@ async def test_event_web_spider_distance(bbot_scanner): def test_event_closest_host(): scan = Scanner() + # first event has a host event1 = scan.make_event("evilcorp.com", "DNS_NAME", parent=scan.root_event) assert event1.host == "evilcorp.com" assert event1.closest_host == "evilcorp.com" + # second event has no host event2 = scan.make_event("wat", "ASDF", parent=event1) assert event2.host == None assert event2.closest_host == "evilcorp.com" + # finding automatically uses the host from the first event finding = scan.make_event({"path": "/tmp/asdf.txt", "description": "test"}, "FINDING", parent=event2) assert finding.data["host"] == "evilcorp.com" assert finding.host == "evilcorp.com" + # same with vuln vuln = scan.make_event( {"path": "/tmp/asdf.txt", "description": "test", "severity": "HIGH"}, "VULNERABILITY", parent=event2 ) assert vuln.data["host"] == "evilcorp.com" assert vuln.host == "evilcorp.com" - # no host + # no host == not allowed event3 = scan.make_event("wat", "ASDF", parent=scan.root_event) assert event3.host == None with pytest.raises(ValueError):