diff --git a/bbot/test/bbot_fixtures.py b/bbot/test/bbot_fixtures.py index abad144d1..0b2a0ec57 100644 --- a/bbot/test/bbot_fixtures.py +++ b/bbot/test/bbot_fixtures.py @@ -42,6 +42,13 @@ def tempwordlist(content): return filename +def tempapkfile(): + current_dir = Path(__file__).parent + with open(current_dir / "owasp_mastg.apk", "rb") as f: + apk_file = f.read() + return apk_file + + @pytest.fixture def clean_default_config(monkeypatch): clean_config = OmegaConf.merge( diff --git a/bbot/test/owasp_mastg.apk b/bbot/test/owasp_mastg.apk new file mode 100644 index 000000000..9a4f638f1 Binary files /dev/null and b/bbot/test/owasp_mastg.apk differ diff --git a/bbot/test/test_step_2/module_tests/test_module_apkpure.py b/bbot/test/test_step_2/module_tests/test_module_apkpure.py index 59a32a66f..17b8e0685 100644 --- a/bbot/test/test_step_2/module_tests/test_module_apkpure.py +++ b/bbot/test/test_step_2/module_tests/test_module_apkpure.py @@ -1,9 +1,10 @@ from pathlib import Path -from .base import ModuleTestBase +from .base import ModuleTestBase, tempapkfile class TestAPKPure(ModuleTestBase): modules_overrides = ["apkpure", "google_playstore", "speculate"] + apk_file = tempapkfile() async def setup_after_prep(self, module_test): await module_test.mock_dns({"blacklanternsecurity.com": {"A": ["127.0.0.99"]}}) @@ -35,7 +36,7 @@ async def setup_after_prep(self, module_test): ) module_test.httpx_mock.add_response( url="https://d.apkpure.com/b/XAPK/com.bbot.test?version=latest", - text="apk", + content=self.apk_file, ) def check(self, module_test, events):