def test_validate_raises_on_extra_field(config): config['driver']['extra'] = 'bar' with pytest.raises(marshmallow.ValidationError) as e: schema_v1.validate(config) assert 'Unknown field' in str(e)
def test_validate_raises_on_invalid_field(config): config['driver']['name'] = int with pytest.raises(marshmallow.ValidationError) as e: schema_v1.validate(config) assert 'Not a valid string.' in str(e)
def _get_v1_config(self): d = util.safe_load(open(self._molecule_file)) errors = schema_v1.validate(d) self._check_errors(errors) return d
def test_base_config(_config): assert {} == schema_v1.validate(_config)
def test_validate(config): data, errors = schema_v1.validate(config) assert {} == errors
def _get_v1_config(self): d = util.safe_load(open(self._molecule_file)) schema_v1.validate(d) return d