From e134e739529b48877d52ffe37ef9ab2ea3d1d7ad Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20tom=20W=C3=B6rden?= <h.tomwoerden@indiscale.com>
Date: Wed, 6 Nov 2024 10:54:21 +0100
Subject: [PATCH] TST: add test cases for compare entities

---
 unittests/test_apiutils.py | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/unittests/test_apiutils.py b/unittests/test_apiutils.py
index 9e6f36f5..4690fa6e 100644
--- a/unittests/test_apiutils.py
+++ b/unittests/test_apiutils.py
@@ -119,6 +119,8 @@ def test_compare_entities():
     r2.add_property("entity_mix_e", value=db.Entity(id=2))
     r1.add_property("entity_mix_d", value=22)
     r2.add_property("entity_mix_d", value=db.Entity(id=2))
+    r1.add_property("entity_mix_w", value=22)
+    r2.add_property("entity_mix_w", value=db.Entity())
     r1.add_property("entity_Ent_e", value=db.Entity(id=2))
     r2.add_property("entity_Ent_e", value=db.Entity(id=2))
     r1.add_property("entity_Ent_d", value=db.Entity(id=2))
@@ -128,8 +130,8 @@ def test_compare_entities():
 
     assert len(diff_r1["parents"]) == 1
     assert len(diff_r2["parents"]) == 0
-    assert len(diff_r1["properties"]) == 10
-    assert len(diff_r2["properties"]) == 10
+    assert len(diff_r1["properties"]) == 11
+    assert len(diff_r2["properties"]) == 11
 
     assert "test" not in diff_r1["properties"]
     assert "test" not in diff_r2["properties"]
@@ -156,6 +158,8 @@ def test_compare_entities():
 
     assert "entity_mix_d" in diff_r1["properties"]
     assert "entity_mix_d" in diff_r2["properties"]
+    assert "entity_mix_w" in diff_r1["properties"]
+    assert "entity_mix_w" in diff_r2["properties"]
     assert "entity_Ent_d" in diff_r1["properties"]
     assert "entity_Ent_d" in diff_r2["properties"]
 
@@ -163,14 +167,16 @@ def test_compare_entities():
 
     assert len(diff_r1["parents"]) == 1
     assert len(diff_r2["parents"]) == 0
-    assert len(diff_r1["properties"]) == 9
-    assert len(diff_r2["properties"]) == 9
+    assert len(diff_r1["properties"]) == 10
+    assert len(diff_r2["properties"]) == 10
 
     assert "entity_id" in diff_r1["properties"]
     assert "entity_id" in diff_r2["properties"]
 
     assert "entity_mix_e" in diff_r1["properties"]
     assert "entity_mix_e" in diff_r2["properties"]
+    assert "entity_mix_w" in diff_r1["properties"]
+    assert "entity_mix_w" in diff_r2["properties"]
     assert "entity_Ent_e" not in diff_r1["properties"]
     assert "entity_Ent_e" not in diff_r2["properties"]
 
-- 
GitLab