🕵️♂️ (2-in-1) Email & Username OSINT suite featuring native MCP support for deep data extraction just from a single Email/Username. Analyzes 2720+ actively maintained scan vectors (210+ email / 2510+ username) for security research, investigations, and digital footprinting.
Python cybersecuritycybersecurity-toolsemail-osintethical-hackingethical-hacking-toolsidentificationinfosecosintosint-emailosint-toolosint-toolsosint-usernamepentestingpythonredteam-toolsredteamingthreat-intelligence
fix: skip update prompt when PyPI check fails (#480)
A-S-Manojbb0620b824a2
diff --git a/tests/test_updater_logic.py b/tests/test_updater_logic.pynew file mode 100644index 0000000..8ab789f--- /dev/null+++ b/tests/test_updater_logic.py@@ -0,0 +1,56 @@+from user_scanner.utils import updater_logic+++def test_skips_prompt_when_pypi_unreachable(monkeypatch, capsys):+ monkeypatch.setattr(+ updater_logic, "load_config", lambda: {"auto_update_status": True}+ )+ monkeypatch.setattr(updater_logic, "get_pypi_version", lambda url: None)+ monkeypatch.setattr(+ updater_logic, "load_local_version", lambda: ("1.4.1.9", "local")+ )++ called = []+ monkeypatch.setattr("builtins.input", lambda *_: called.append(True))++ updater_logic.check_for_updates()++ out = capsys.readouterr().out+ assert "New version available" not in out+ assert "Could not reach PyPI" in out+ assert called == [] # input() never invoked+++def test_prompts_when_real_update_available(monkeypatch, capsys):+ monkeypatch.setattr(+ updater_logic, "load_config", lambda: {"auto_update_status": True}+ )+ monkeypatch.setattr(updater_logic, "get_pypi_version", lambda url: "9.9.9")+ monkeypatch.setattr(+ updater_logic, "load_local_version", lambda: ("1.4.1.9", "local")+ )+ monkeypatch.setattr("builtins.input", lambda _: "n")++ updater_logic.check_for_updates()++ out = capsys.readouterr().out+ assert "New version available" in out+++def test_no_prompt_when_up_to_date(monkeypatch, capsys):+ monkeypatch.setattr(+ updater_logic, "load_config", lambda: {"auto_update_status": True}+ )+ monkeypatch.setattr(updater_logic, "get_pypi_version", lambda url: "1.4.1.9")+ monkeypatch.setattr(+ updater_logic, "load_local_version", lambda: ("1.4.1.9", "local")+ )++ called = []+ monkeypatch.setattr("builtins.input", lambda *_: called.append(True))++ updater_logic.check_for_updates()++ out = capsys.readouterr().out+ assert "New version available" not in out+ assert called == []\ No newline at end of filediff --git a/user_scanner/utils/updater_logic.py b/user_scanner/utils/updater_logic.pyindex fe55047..4874a1f 100644--- a/user_scanner/utils/updater_logic.py+++ b/user_scanner/utils/updater_logic.py@@ -22,6 +22,10 @@ def check_for_updates():latest_ver = get_pypi_version(PYPI_URL)current_ver, _ = load_local_version()+ if latest_ver is None:+ print(f"[{Y}!{X}] {R}Could not reach PyPI, skipping update check.{X}")+ return+if current_ver != latest_ver:print(f"\n[!] New version available: "