From fff09bfe4a333a760dd680b946d7ebc570df0659 Mon Sep 17 00:00:00 2001 From: Daniel <d.hornung@indiscale.com> Date: Fri, 24 Nov 2023 11:06:41 +0100 Subject: [PATCH] TEST: More tests for #111 --- unittests/test_apiutils.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/unittests/test_apiutils.py b/unittests/test_apiutils.py index 434e276f..b9a02926 100644 --- a/unittests/test_apiutils.py +++ b/unittests/test_apiutils.py @@ -365,10 +365,15 @@ def test_bug_109(): @pytest.mark.xfail(reason="Issue https://gitlab.com/linkahead/linkahead-pylib/-/issues/111") def test_failing_merge_entities_111(): prop_a = db.Property() - prop_b = db.Property(name="b", datatype=db.TEXT) + prop_parent = db.Property(name="prop_parent") + prop_b = db.Property(name="b", datatype=db.DOUBLE, unit="µs", value=1.1).add_parent(prop_parent) + print(prop_b) db.apiutils.merge_entities(prop_a, prop_b) - assert prop_a.name == "b" # OK - assert prop_a.datatype == db.TEXT # fails + assert prop_a.name == prop_b.name # OK + assert prop_parent.name in [par.name for par in prop_a.get_parents()] # OK + assert prop_a.value == prop_b.value # fails + assert prop_a.datatype == db.DOUBLE # fails + assert prop_a.unit == prop_b.unit # fails def test_wrong_merge_conflict_reference(): -- GitLab