Skip to content

Commit

Permalink
fixed tests again
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTechromancer committed Nov 14, 2023
1 parent 110cac2 commit 404433c
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions bbot/test/test_step_2/module_tests/test_module_web_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,14 @@ class TestWebReport(ModuleTestBase):

async def setup_before_prep(self, module_test):
# secretsdb --> FINDING
module_test.httpx_mock.add_response(
url="https://raw.githubusercontent.com/blacklanternsecurity/secrets-patterns-db/master/db/rules-stable.yml",
text="""patterns:
- pattern:
confidence: 99
name: Asymmetric Private Key
regex: '-----BEGIN ((EC|PGP|DSA|RSA|OPENSSH) )?PRIVATE KEY( BLOCK)?-----'""",
)
# wappalyzer --> TECHNOLOGY
# badsecrets --> VULNERABILITY
respond_args = {"response_data": web_body}
module_test.set_expect_requests(respond_args=respond_args)

def check(self, module_test, events):
for e in events:
module_test.log.critical(e)
report_file = module_test.scan.home / "web_report.html"
with open(report_file) as f:
report_content = f.read()
Expand All @@ -31,12 +25,7 @@ def check(self, module_test, events):
<li><strong>http://127.0.0.1:8888/</strong>"""
in report_content
)
assert (
"""<h3>FINDING</h3>
<ul>
<li>Possible secret (Asymmetric Private Key)"""
in report_content
)
assert """Possible secret (Asymmetric Private Key)""" in report_content
assert "<h3>TECHNOLOGY</h3>" in report_content
assert "<p>flask</p>" in report_content

Expand Down

0 comments on commit 404433c

Please sign in to comment.