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