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

TST(data-model-parser): replaced static xml tests by more specific ones

parent 0c25885d
Branches
Tags
2 merge requests!128MNT: Added a warning when column metadata is not configured, and a better...,!115add datatype, unit and description to properties that are part of Records
Pipeline #57814 failed
...@@ -612,14 +612,13 @@ RT2: ...@@ -612,14 +612,13 @@ RT2:
obligatory_properties: *RT1_oblig obligatory_properties: *RT1_oblig
""" """
model = parse_model_from_string(model_string) model = parse_model_from_string(model_string)
assert str(model) == """{'foo': <Property name="foo" datatype="INTEGER"/>
, 'RT1': <RecordType name="RT1"> assert len(model) == 3
<Property name="foo" importance="OBLIGATORY" flag="inheritance:FIX"/> assert isinstance(model["foo"], db.Property)
</RecordType> assert model["foo"].datatype == db.INTEGER
, 'RT2': <RecordType name="RT2"> for st in ("RT1", "RT2"):
<Property name="foo" importance="OBLIGATORY" flag="inheritance:FIX"/> assert isinstance(model[st], db.RecordType)
</RecordType> assert model[st].get_property("foo").datatype == db.INTEGER
}"""
# Aliasing with override # Aliasing with override
model_string = """ model_string = """
...@@ -634,16 +633,13 @@ RT2: ...@@ -634,16 +633,13 @@ RT2:
bar: bar:
""" """
model = parse_model_from_string(model_string) model = parse_model_from_string(model_string)
assert str(model) == """{'foo': <Property name="foo" datatype="INTEGER"/>
, 'RT1': <RecordType name="RT1"> assert len(model) == 4
<Property name="foo" importance="OBLIGATORY" flag="inheritance:FIX"/> assert isinstance(model["bar"], db.RecordType)
</RecordType> for st in ("RT1", "RT2"):
, 'RT2': <RecordType name="RT2"> assert isinstance(model[st], db.RecordType)
<Property name="foo" importance="OBLIGATORY" flag="inheritance:FIX"/> assert model[st].get_property("foo").datatype == db.INTEGER
<Property name="bar" importance="OBLIGATORY" flag="inheritance:FIX"/> assert model["RT2"].get_property("bar").datatype == "bar"
</RecordType>
, 'bar': <RecordType name="bar"/>
}"""
def test_comparison_yaml_model(capfd): def test_comparison_yaml_model(capfd):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment