Beispiel #1
0
def test_wwan_when_no_arguments_are_passed():
    c = DummyRadioControl()
    with pytest.raises(ValueError):
        c.wwan()
Beispiel #2
0
def test_call_when_raise_error():
    c = DummyRadioControl(raise_error=Exception)
    with pytest.raises(Exception):
        c()
Beispiel #3
0
def test_wwan_when_raise_error():
    c = DummyRadioControl(raise_error=Exception)
    with pytest.raises(Exception):
        c.wwan()
Beispiel #4
0
def test_wifi_off_when_raise_error():
    c = DummyRadioControl(raise_error=Exception)
    with pytest.raises(Exception):
        c.wifi_off()
Beispiel #5
0
def test_wwan():
    result_wwan = True
    c = DummyRadioControl(result_wwan=result_wwan)
    assert c.wwan() == result_wwan
Beispiel #6
0
def test_wifi_off():
    c = DummyRadioControl()
    c.wifi_off()
    assert c.called_wifi_off == 1
Beispiel #7
0
def test_wifi():
    result_wifi = True
    c = DummyRadioControl(result_wifi=result_wifi)
    assert c.wifi() == result_wifi
Beispiel #8
0
def test_all_off():
    c = DummyRadioControl()
    c.all_off()
    assert c.called_all_off == 1
Beispiel #9
0
def test_call():
    result_call = Radio(True, True, True, True)
    c = DummyRadioControl(result_call)
    assert c() == result_call
Beispiel #10
0
def test_wwan_on():
    c = DummyRadioControl()
    c.wwan_on()
    assert c.called_wwan_on == 1