Skip to content
Snippets Groups Projects
Verified Commit 9d8c9d0a authored by Timm Fitschen's avatar Timm Fitschen
Browse files

TST: add tests for server issues #143 & #144

parent fdb46c54
No related branches found
No related tags found
No related merge requests found
Pipeline #35171 passed
......@@ -1176,3 +1176,29 @@ def test_192():
assert count6 == 1
assert count7 == 1
assert count8 == 1
@pytest.mark.xfail(reason="fix needed")
@pytest.mark.parametrize("num", ["1e+23", "5e22", "2e-323"])
def test_143(num):
"""https://gitlab.com/caosdb/caosdb-server/-/issues/144"""
db.Property(name="scientific_notation", datatype=db.DOUBLE).insert()
db.RecordType(name="RT1").add_property("scientific_notation", value=num).insert()
db.execute_query(f"FIND RECORDTYPE RT1 WITH scientific_notation={num}", unique=True)
db.execute_query(f"FIND RECORDTYPE RT1 WITH scientific_notation='{num}'", unique=True)
db.execute_query(f"FIND RECORDTYPE RT1 WITH scientific_notation=\"{num}\"", unique=True)
db.execute_query(f"FIND RECORDTYPE RT1 WITH scientific_notation = {num}", unique=True)
db.execute_query(f"FIND RECORDTYPE RT1 WITH scientific_notation = '{num}'", unique=True)
db.execute_query(f"FIND RECORDTYPE RT1 WITH scientific_notation = \"{num}\"", unique=True)
def test_144():
"""https://gitlab.com/caosdb/caosdb-server/-/issues/144"""
db.Property(name="scientific_notation", datatype=db.DOUBLE, value="1e23").insert()
value = db.execute_query("FIND PROPERTY scientific_notation", unique=True).value
assert str(value) == "1e+23"
assert isinstance(value, float)
assert value == 1e23
assert value == 1e+23
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment