Skip to content

Commit 3501f3a

Browse files
committed
Fix more test assertions: e.data -> e.url/e.pretty_string for URL events
1 parent 0a5051d commit 3501f3a

3 files changed

Lines changed: 12 additions & 12 deletions

File tree

bbot/test/test_step_2/module_tests/test_module_excavate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def check(self, module_test, events):
127127
)
128128

129129
assert any(
130-
e.type == "URL_UNVERIFIED" and "miscellaneous.html" in e.data and "x50-uart-driver" not in e.data
130+
e.type == "URL_UNVERIFIED" and "miscellaneous.html" in e.url and "x50-uart-driver" not in e.url
131131
for e in events
132132
)
133133

@@ -1560,7 +1560,7 @@ async def setup_after_prep(self, module_test):
15601560
def check(self, module_test, events):
15611561
# excavate should skip PDF responses entirely, so no URLs or findings should be extracted from the body
15621562
url_unverified_events = [
1563-
e for e in events if e.type == "URL_UNVERIFIED" and "pdf-extracted.test.notreal" in e.data
1563+
e for e in events if e.type == "URL_UNVERIFIED" and "pdf-extracted.test.notreal" in e.url
15641564
]
15651565
assert len(url_unverified_events) == 0, (
15661566
f"PDF body should not be processed by excavate, but got: {url_unverified_events}"

bbot/test/test_step_2/module_tests/test_module_ffuf.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ async def setup_before_prep(self, module_test):
2323
module_test.set_expect_requests(expect_args=expect_args, respond_args=respond_args)
2424

2525
def check(self, module_test, events):
26-
assert any(e.type == "URL_UNVERIFIED" and "admin" in e.data for e in events)
27-
assert not any(e.type == "URL_UNVERIFIED" and "11111111" in e.data for e in events)
26+
assert any(e.type == "URL_UNVERIFIED" and "admin" in e.url for e in events)
27+
assert not any(e.type == "URL_UNVERIFIED" and "11111111" in e.url for e in events)
2828

2929

3030
class TestFFUF2(TestFFUF):
@@ -41,8 +41,8 @@ async def setup_before_prep(self, module_test):
4141
module_test.set_expect_requests(expect_args=expect_args, respond_args=respond_args)
4242

4343
def check(self, module_test, events):
44-
assert any(e.type == "URL_UNVERIFIED" and "console" in e.data for e in events)
45-
assert not any(e.type == "URL_UNVERIFIED" and "11111111" in e.data for e in events)
44+
assert any(e.type == "URL_UNVERIFIED" and "console" in e.url for e in events)
45+
assert not any(e.type == "URL_UNVERIFIED" and "11111111" in e.url for e in events)
4646

4747

4848
class TestFFUF_ignorecase(TestFFUF):
@@ -65,8 +65,8 @@ async def setup_before_prep(self, module_test):
6565
module_test.set_expect_requests(expect_args=expect_args, respond_args=respond_args)
6666

6767
def check(self, module_test, events):
68-
assert any(e.type == "URL_UNVERIFIED" and "admin" in e.data for e in events)
69-
assert not any(e.type == "URL_UNVERIFIED" and "Admin" in e.data for e in events)
68+
assert any(e.type == "URL_UNVERIFIED" and "admin" in e.url for e in events)
69+
assert not any(e.type == "URL_UNVERIFIED" and "Admin" in e.url for e in events)
7070

7171

7272
class TestFFUFHeaders(TestFFUF):
@@ -86,5 +86,5 @@ async def setup_before_prep(self, module_test):
8686
module_test.set_expect_requests(expect_args=expect_args, respond_args=respond_args)
8787

8888
def check(self, module_test, events):
89-
assert any(e.type == "URL_UNVERIFIED" and "console" in e.data for e in events)
90-
assert not any(e.type == "URL_UNVERIFIED" and "11111111" in e.data for e in events)
89+
assert any(e.type == "URL_UNVERIFIED" and "console" in e.url for e in events)
90+
assert not any(e.type == "URL_UNVERIFIED" and "11111111" in e.url for e in events)

bbot/test/test_step_2/module_tests/test_module_httpx.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ def check(self, module_test, events):
124124
assert 1 == len([e for e in events if e.type == "URL" and e.url == "http://127.0.0.1:8888/"])
125125
assert 1 == len([e for e in events if e.type == "URL" and e.url == "http://127.0.0.1:8888/test.aspx"])
126126
assert 1 == len([e for e in events if e.type == "URL" and e.url == "http://127.0.0.1:8888/test.txt"])
127-
assert not any(e for e in events if "URL" in e.type and ".svg" in e.data)
128-
assert not any(e for e in events if "URL" in e.type and ".woff" in e.data)
127+
assert not any(e for e in events if "URL" in e.type and ".svg" in e.url)
128+
assert not any(e for e in events if "URL" in e.type and ".woff" in e.url)
129129

130130

131131
class TestHTTPX_querystring_removed(ModuleTestBase):

0 commit comments

Comments
 (0)