Esempio n. 1
0
def test_set_hostname_when_raise_error():
    c = DummyGeneralControl(raise_error=Exception)
    with pytest.raises(Exception):
        c.set_hostname('')
Esempio n. 2
0
def test_set_hostname():
    hostname = 'test'
    c = DummyGeneralControl()
    c.set_hostname(hostname)
    assert c.set_hostname_args == [hostname]
Esempio n. 3
0
def test_call():
    result_call = General(NetworkManagerState.CONNECTED_GLOBAL,
                          NetworkConnectivity.FULL, True, True, True, True)
    c = DummyGeneralControl(result_call)
    assert c() == result_call
Esempio n. 4
0
def test_get_hostname():
    result_hostname = 'test'
    c = DummyGeneralControl(result_hostname=result_hostname)
    assert c.get_hostname() == result_hostname
Esempio n. 5
0
def test_status_when_no_arguments_are_passed():
    c = DummyGeneralControl()
    with pytest.raises(ValueError):
        c.status()
Esempio n. 6
0
def test_status_when_raise_error():
    c = DummyGeneralControl(raise_error=Exception)
    with pytest.raises(Exception):
        c.status()
Esempio n. 7
0
def test_call_when_raise_error():
    c = DummyGeneralControl(raise_error=Exception)
    with pytest.raises(Exception):
        c()
Esempio n. 8
0
def test_call():
    result_call = General('connected', 'full', 'enabled', 'enabled', 'enabled', 'enabled')
    c = DummyGeneralControl(result_call)
    assert c() == result_call