def test_status_when_raise_error(): c = DummyDeviceControl(raise_error=Exception) with pytest.raises(Exception): c.status()
def test_status(): result_call = [Device('eth0', 'ethernet', 'connected,', 'MyNet')] c = DummyDeviceControl(result_call) assert c.status() == result_call