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

TST: added test for comparing importances of properties belonging to records (concrete properties)

parent a2c4dd85
No related branches found
No related tags found
2 merge requests!107ENH: add entity getters and cached functions,!103Improving the compare_entities functions
Pipeline #36394 passed with warnings
...@@ -233,6 +233,19 @@ def test_compare_special_properties(): ...@@ -233,6 +233,19 @@ def test_compare_special_properties():
assert len(diff_r1["properties"]) == 0 assert len(diff_r1["properties"]) == 0
assert len(diff_r2["properties"]) == 0 assert len(diff_r2["properties"]) == 0
def test_compare_importances():
r1 = db.Record()
r2 = db.Record()
r1.add_property("test", value=2, unit="cm", importance="SUGGESTED")
r2.add_property("test", value=2, unit="cm")
assert not empty_diff(r1, r2)
diff_r1, diff_r2 = compare_entities(r1, r2)
assert diff_r1["properties"]["test"]["importance"] == "SUGGESTED"
assert diff_r2["properties"]["test"]["importance"] == "FIX"
for diff in (diff_r1, diff_r2):
assert len(diff["properties"]["test"]) == 1
assert len(diff["parents"]) == 0
@pytest.mark.xfail @pytest.mark.xfail
def test_compare_properties(): def test_compare_properties():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment