Пример #1
0
def test_show_when_raise_error():
    c = DummyDeviceControl(raise_error=Exception)
    with pytest.raises(Exception):
        c.show('eth0')
Пример #2
0
def test_show_when_no_arguments_are_passed():
    c = DummyDeviceControl()
    with pytest.raises(ValueError):
        c.show('eth0')
Пример #3
0
def test_show():
    result_show = {'key': 'value'}
    c = DummyDeviceControl(result_show=result_show)
    ifname = 'eth0'
    assert c.show(ifname) == result_show
    assert c.show_args == [ifname]