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

TST(yaml-model-parser): test for correct comparison of yaml models

parent dd637a40
No related branches found
No related tags found
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 #57811 failed
...@@ -674,14 +674,6 @@ test_reference: ...@@ -674,14 +674,6 @@ test_reference:
# comparison with a version taken from a LinkAhead instance will have these attributes. # comparison with a version taken from a LinkAhead instance will have these attributes.
# Furthermore, RT2 will be set as the datatype **in object version** in the yaml definition, while # Furthermore, RT2 will be set as the datatype **in object version** in the yaml definition, while
# it is an ID in case of the version from the LinkAhead instance. # it is an ID in case of the version from the LinkAhead instance.
# p_foo = db.Property(name="foo", datatype="INTEGER", description="bla bla", unit="m")
# rt2 = db.RecordType(name="RT2")
# rt1 = db.RecordType(name="RT1")
# rt1.add_property(p_foo)
# rt1.add_property(rt2)
# existing_entities = [
# p_foo, rt2, rt1]
server_response = """ server_response = """
<Entities> <Entities>
...@@ -738,13 +730,11 @@ test_reference: ...@@ -738,13 +730,11 @@ test_reference:
caosadvancedtools.models.parser.db.Container.insert = Mock() caosadvancedtools.models.parser.db.Container.insert = Mock()
model.sync_data_model(True, True) model.sync_data_model(True, True)
assert caosadvancedtools.models.parser.db.Container.update.called assert not caosadvancedtools.models.parser.db.Container.update.called
assert not caosadvancedtools.models.parser.db.Container.insert.called assert not caosadvancedtools.models.parser.db.Container.insert.called
output, err = capfd.readouterr() output, err = capfd.readouterr()
print(output) assert "No new entities." in output
assert False assert "No differences found. No update" in output
# TODO: test that there were no changes required
def test_sync_output(capfd): def test_sync_output(capfd):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment