def test_wifi_connect(): c = DummyDeviceControl() ssid = 'ssid' password = '******' ifname = 'wlan0' c.wifi_connect(ssid, password) assert c.wifi_connect_args[0] == (ssid, password, None, None) c.wifi_connect(ssid, password, ifname) assert c.wifi_connect_args[1] == (ssid, password, ifname, None) c.wifi_connect(ssid, password, ifname, wait=10) assert c.wifi_connect_args[2] == (ssid, password, ifname, 10)
def test_wifi_connect_when_raise_error(): c = DummyDeviceControl(raise_error=Exception) ssid = 'ssid' password = '******' with pytest.raises(Exception): c.wifi_connect(ssid, password)
def test_wifi_connect(): c = DummyDeviceControl() ssid = 'ssid' password = '******' c.wifi_connect(ssid, password) assert c.wifi_connect_args == [(ssid, password)]