Skip to content
Snippets Groups Projects
Commit 7f645c74 authored by Alexander Schlemmer's avatar Alexander Schlemmer
Browse files

TST: added test for error message in case of broken record definition

parent ce4843f2
No related branches found
No related tags found
2 merge requests!198REL: Release 0.10.0,!182Better error message
Pipeline #56439 passed with warnings
This commit is part of merge request !182. Comments created here will be created in the context of that merge request.
......@@ -335,3 +335,17 @@ EmptyConverter:
with pytest.raises(RuntimeError, match="Definition of converter \"EmptyConverter\" is empty"):
scan_structure_elements(DictElement(name="", value=data), broken_definition, converter_registry)
broken_yaml = """
Converter:
type: DictElement
records:
TestRecord: "42"
"""
broken_definition = _load_definition_from_yaml_dict(
[yaml.load(broken_yaml, Loader=yaml.SafeLoader)])
converter_registry = create_converter_registry(broken_definition)
with pytest.raises(RuntimeError, match="dict expected, but found str: 42"):
scan_structure_elements(DictElement(name="", value=data), broken_definition, converter_registry)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment