def test_disconnect(): c = DummyDeviceControl() ifname = 'eth0' c.disconnect(ifname) assert c.disconnect_args[0] == (ifname, None)
def test_disconnect_when_raise_error(): c = DummyDeviceControl(raise_error=Exception) with pytest.raises(Exception): c.disconnect('eth0')
def test_disconnect(): c = DummyDeviceControl() ifname = 'eth0' c.disconnect(ifname) assert c.disconnect_args == [ifname]