示例#1
0
def test_set_hostname_when_raise_error():
    c = DummyGeneralControl(raise_error=Exception)
    with pytest.raises(Exception):
        c.set_hostname('')
示例#2
0
def test_set_hostname():
    hostname = 'test'
    c = DummyGeneralControl()
    c.set_hostname(hostname)
    assert c.set_hostname_args == [hostname]
示例#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
示例#4
0
def test_get_hostname():
    result_hostname = 'test'
    c = DummyGeneralControl(result_hostname=result_hostname)
    assert c.get_hostname() == result_hostname
示例#5
0
def test_status_when_no_arguments_are_passed():
    c = DummyGeneralControl()
    with pytest.raises(ValueError):
        c.status()
示例#6
0
def test_status_when_raise_error():
    c = DummyGeneralControl(raise_error=Exception)
    with pytest.raises(Exception):
        c.status()
示例#7
0
def test_call_when_raise_error():
    c = DummyGeneralControl(raise_error=Exception)
    with pytest.raises(Exception):
        c()
示例#8
0
def test_call():
    result_call = General('connected', 'full', 'enabled', 'enabled', 'enabled', 'enabled')
    c = DummyGeneralControl(result_call)
    assert c() == result_call