コード例 #1
0
ファイル: test_device.py プロジェクト: ushiboy/nmcli
def test_show_when_raise_error():
    c = DummyDeviceControl(raise_error=Exception)
    with pytest.raises(Exception):
        c.show('eth0')
コード例 #2
0
ファイル: test_device.py プロジェクト: ushiboy/nmcli
def test_show_when_no_arguments_are_passed():
    c = DummyDeviceControl()
    with pytest.raises(ValueError):
        c.show('eth0')
コード例 #3
0
ファイル: test_device.py プロジェクト: ushiboy/nmcli
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]