Skip to content

Commit d95f9fd

Browse files
Fix tests/test_wifi_service.py
1 parent d92c70c commit d95f9fd

1 file changed

Lines changed: 2 additions & 16 deletions

File tree

tests/test_wifi_service.py

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -406,19 +406,12 @@ def tearDown(self):
406406

407407
def test_enable_hotspot_applies_config(self):
408408
"""Test enable_hotspot reads config and configures AP."""
409-
prefs = MockSharedPreferences("com.micropythonos.system.hotspot")
409+
prefs = MockSharedPreferences("com.micropythonos.settings.hotspot")
410410
editor = prefs.edit()
411411
editor.put_bool("enabled", True)
412412
editor.put_string("ssid", "MyAP")
413413
editor.put_string("password", "ap-pass")
414-
editor.put_int("channel", 6)
415-
editor.put_bool("hidden", True)
416-
editor.put_int("max_clients", 3)
417414
editor.put_string("authmode", "wpa2")
418-
editor.put_string("ip", "192.168.4.2")
419-
editor.put_string("netmask", "255.255.255.0")
420-
editor.put_string("gateway", "192.168.4.1")
421-
editor.put_string("dns", "1.1.1.1")
422415
editor.commit()
423416

424417
mock_network = HotspotMockNetwork()
@@ -434,15 +427,8 @@ def test_enable_hotspot_applies_config(self):
434427
self.assertTrue(ap_wlan.active())
435428
self.assertFalse(sta_wlan.active())
436429
self.assertEqual(ap_wlan._config.get("essid"), "MyAP")
437-
self.assertEqual(ap_wlan._config.get("channel"), 6)
438-
self.assertTrue(ap_wlan._config.get("hidden"))
439-
self.assertEqual(ap_wlan._config.get("max_clients"), 3)
440430
self.assertEqual(ap_wlan._config.get("authmode"), mock_network.AUTH_WPA2_PSK)
441431
self.assertEqual(ap_wlan._config.get("password"), "ap-pass")
442-
self.assertEqual(
443-
ap_wlan.ifconfig(),
444-
("192.168.4.2", "255.255.255.0", "192.168.4.1", "1.1.1.1"),
445-
)
446432

447433
def test_enable_hotspot_respects_busy_flag(self):
448434
"""Test enable_hotspot returns False when WiFi is busy."""
@@ -483,7 +469,7 @@ def test_disable_hotspot_desktop_mode(self):
483469

484470
def test_auto_connect_with_hotspot_enabled_prefers_ap_mode(self):
485471
"""Test auto_connect uses hotspot mode when enabled in config."""
486-
prefs = MockSharedPreferences("com.micropythonos.system.hotspot")
472+
prefs = MockSharedPreferences("com.micropythonos.settings.hotspot")
487473
editor = prefs.edit()
488474
editor.put_bool("enabled", True)
489475
editor.commit()

0 commit comments

Comments
 (0)