From 3bce8369f9316b042429cc9c5e9700b129f562e8 Mon Sep 17 00:00:00 2001 From: Dom Whewell Date: Sun, 12 May 2024 10:41:16 +0100 Subject: [PATCH] Ensure duplicated secret in zip folder does not get detected --- bbot/test/test_step_2/module_tests/test_module_trufflehog.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bbot/test/test_step_2/module_tests/test_module_trufflehog.py b/bbot/test/test_step_2/module_tests/test_module_trufflehog.py index 827f76d6fa..4d7122276b 100644 --- a/bbot/test/test_step_2/module_tests/test_module_trufflehog.py +++ b/bbot/test/test_step_2/module_tests/test_module_trufflehog.py @@ -541,6 +541,7 @@ async def setup_before_prep(self, module_test): data = io.BytesIO() with zipfile.ZipFile(data, mode="w", compression=zipfile.ZIP_DEFLATED) as z: z.writestr("test.txt", self.file_content) + z.writestr("folder/test2.txt", self.file_content) data.seek(0) zip_content = data.getvalue() module_test.httpx_mock.add_response( @@ -861,7 +862,7 @@ def check(self, module_test, events): assert content == self.file_content, "File content doesn't match" github_workflow_event = [e for e in vuln_events if "bbot" in e.data["description"]][0].source file = Path(github_workflow_event.data["path"]) - assert file.is_file(), "Destination zip does not exist" + assert file.is_file(), "Destination file does not exist" docker_source_event = [e for e in vuln_events if e.data["host"] == "hub.docker.com"][0].source file = Path(docker_source_event.data["path"]) assert file.is_file(), "Destination image does not exist" @@ -888,7 +889,7 @@ def check(self, module_test, events): assert content == self.file_content, "File content doesn't match" github_workflow_event = [e for e in finding_events if "bbot" in e.data["description"]][0].source file = Path(github_workflow_event.data["path"]) - assert file.is_file(), "Destination zip does not exist" + assert file.is_file(), "Destination file does not exist" docker_source_event = [e for e in finding_events if e.data["host"] == "hub.docker.com"][0].source file = Path(docker_source_event.data["path"]) assert file.is_file(), "Destination image does not exist"