Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ZanSara committed Dec 7, 2024
1 parent b970e1e commit feb7cde
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/unit_tests/test_webcam_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion zanzocam/webcam/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit feb7cde

Please sign in to comment.