def test_resource_class_error(self): with pytest.raises(InvalidConfigError) as excinfo: target_factory.make_resource(None, 'UnknownResource', None, {}) assert "unknown resource class" in excinfo.value.msg
def test_resource_param_error(self): with pytest.raises(InvalidConfigError) as excinfo: target_factory.make_resource(None, 'NetworkSerialPort', 'serial', {'port': None}) assert "failed to create" in excinfo.value.msg