def test_get_hostname_when_raise_error(): c = DummyGeneralControl(raise_error=Exception) with pytest.raises(Exception): c.get_hostname()
def test_get_hostname(): result_hostname = 'test' c = DummyGeneralControl(result_hostname=result_hostname) assert c.get_hostname() == result_hostname