From feb7cdebffc9f57702fa1cfc1b837121ae239d33 Mon Sep 17 00:00:00 2001 From: ZanSara Date: Sat, 7 Dec 2024 11:53:14 +0000 Subject: [PATCH] tests --- tests/unit_tests/test_webcam_system.py | 2 +- zanzocam/webcam/system.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit_tests/test_webcam_system.py b/tests/unit_tests/test_webcam_system.py index 806a8b3..331c68c 100644 --- a/tests/unit_tests/test_webcam_system.py +++ b/tests/unit_tests/test_webcam_system.py @@ -348,7 +348,7 @@ def test_report_general_status(monkeypatch): class Empty(): def __getattr__(self, attr): - return lambda *a, **k: {"ssid": "mock network"} # wifi data needs this key + return lambda *a, **k: None monkeypatch.setattr(webcam, "system", Empty()) status = original_system.report_general_status() diff --git a/zanzocam/webcam/system.py b/zanzocam/webcam/system.py index 3af4c37..b96f904 100644 --- a/zanzocam/webcam/system.py +++ b/zanzocam/webcam/system.py @@ -80,7 +80,7 @@ def report_general_status() -> Dict: raise RaceConditionError() status['wifi data'] = get_wifi_data() - if status['wifi data']["ssid"] == "n/a": + if status['wifi data'] and "ssid" in status['wifi data'] and status['wifi data']["ssid"] == "n/a": autohotspot_status = run_autohotspot() if autohotspot_status is None: