From c753451c4e13d5f240092516bcfbd31b26eaa948 Mon Sep 17 00:00:00 2001
From: Timm Fitschen <t.fitschen@indiscale.com>
Date: Wed, 8 Sep 2021 11:37:02 +0200
Subject: [PATCH] Add more sophisticated test for caosdb-server#127

---
 tests/test_issues_server.py | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/tests/test_issues_server.py b/tests/test_issues_server.py
index 3027281..e0a86b9 100644
--- a/tests/test_issues_server.py
+++ b/tests/test_issues_server.py
@@ -377,8 +377,16 @@ def test_issue_154_with_versioning():
 
 def test_issue_127():
     """https://gitlab.com/caosdb/caosdb-server/-/issues/127"""
-    p = db.Property("TestProp", datatype=db.LIST(db.DOUBLE)).insert()
-    rt = db.RecordType("TestRT").add_property("TestProp", ["NaN"]).insert()
+    p = db.Property(name="TestDoubleProperty", datatype=db.LIST(db.DOUBLE)).insert()
+    rt = db.RecordType(name="TestRecordType").add_property(name="TestDoubleProperty",
+                                                           value=["nan"]).insert()
+
+    test1 = db.execute_query("FIND TestRecordType", unique=True)
+    assert math.isnan(test1.get_property("TestDoubleProperty").value[0])
+
+    test2 = db.execute_query(
+        "FIND TestRecordType WITH TestDoubleProperty = NaN", unique=True)
+    assert math.isnan(test1.get_property("TestDoubleProperty").value[0])
 
 
 def test_issue_170():
-- 
GitLab