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
Loading
Pipeline #56439 passed with warnings
...@@ -335,3 +335,17 @@ EmptyConverter: ...@@ -335,3 +335,17 @@ EmptyConverter:
with pytest.raises(RuntimeError, match="Definition of converter \"EmptyConverter\" is empty"): with pytest.raises(RuntimeError, match="Definition of converter \"EmptyConverter\" is empty"):
scan_structure_elements(DictElement(name="", value=data), broken_definition, converter_registry) 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.
Please register or to comment