A minimal WiFiManager with side-effecting init paths stubbed.
()
| 14 | |
| 15 | @pytest.fixture |
| 16 | def manager(): |
| 17 | """A minimal WiFiManager with side-effecting init paths stubbed.""" |
| 18 | from wifi_manager import WiFiManager |
| 19 | |
| 20 | shared = MagicMock() |
| 21 | shared.config = { |
| 22 | 'wifi_ssid_change_debounce_seconds': 30, |
| 23 | 'wifi_ap_ssid': 'Ragnar', |
| 24 | 'wifi_ap_password': 'ragnarconnect', |
| 25 | 'wifi_default_interface': 'auto', |
| 26 | } |
| 27 | shared.active_network_ssid = None |
| 28 | shared.currentdir = '/tmp' |
| 29 | |
| 30 | with patch('wifi_manager.detect_wifi_interface', return_value='wlan0'), \ |
| 31 | patch('wifi_manager.get_db', return_value=None), \ |
| 32 | patch.object(WiFiManager, 'setup_ap_logger'), \ |
| 33 | patch.object(WiFiManager, 'load_wifi_config'): |
| 34 | wm = WiFiManager(shared) |
| 35 | return wm |
| 36 | |
| 37 | |
| 38 | # --------------------------------------------------------------------------- |
nothing calls this directly
no test coverage detected