From d75f64686d3ebc943f9b753c8d8b623e27d44471 Mon Sep 17 00:00:00 2001
From: Alexander Schlemmer <a.schlemmer@indiscale.com>
Date: Mon, 18 Nov 2024 11:52:04 +0100
Subject: [PATCH] TST(yaml-model-parser): test for correct comparison of yaml
 models

---
 unittests/test_yaml_model_parser.py | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)

diff --git a/unittests/test_yaml_model_parser.py b/unittests/test_yaml_model_parser.py
index e645dcd6..e3e9a0af 100644
--- a/unittests/test_yaml_model_parser.py
+++ b/unittests/test_yaml_model_parser.py
@@ -674,14 +674,6 @@ test_reference:
     # 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
     # 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 = """
 <Entities>
@@ -738,13 +730,11 @@ test_reference:
     caosadvancedtools.models.parser.db.Container.insert = Mock()
 
     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
     output, err = capfd.readouterr()
-    print(output)
-    assert False
-
-    # TODO: test that there were no changes required
+    assert "No new entities." in output
+    assert "No differences found. No update" in output
 
 
 def test_sync_output(capfd):
-- 
GitLab