Beispiel #1
0
def test_wifi_hotspot():
    ifname = 'wlan0'
    con_name = 'MyHotspot'
    ssid = 'ssid'
    band = 'a'
    channel = 123
    password = '******'
    r = Hotspot(ifname, con_name, ssid, password)
    c = DummyDeviceControl(result_wifi_hotspot=r)
    assert c.wifi_hotspot(ifname, con_name, ssid, band, channel, password) == r
    assert c.wifi_hotspot_args == [(ifname, con_name, ssid, band, channel,
                                    password)]
Beispiel #2
0
def test_wifi_hotspot_when_no_arguments_are_passed():
    c = DummyDeviceControl()
    with pytest.raises(ValueError):
        c.wifi_hotspot()
Beispiel #3
0
def test_wifi_hotspot_when_raise_error():
    c = DummyDeviceControl(raise_error=Exception)
    with pytest.raises(Exception):
        c.wifi_hotspot()