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

TST: add tests for server #166

parent 9d8c9d0a
No related branches found
No related tags found
1 merge request!58TST for server#166
Pipeline #35153 passed
...@@ -1202,3 +1202,27 @@ def test_144(): ...@@ -1202,3 +1202,27 @@ def test_144():
assert isinstance(value, float) assert isinstance(value, float)
assert value == 1e23 assert value == 1e23
assert value == 1e+23 assert value == 1e+23
def test_166():
"""https://gitlab.com/caosdb/caosdb-server/-/issues/166"""
db.RecordType(name="exists").insert()
db.Property(name="exists_property", datatype=db.INTEGER).insert()
db.RecordType(name="RT1").add_parent("exists").insert()
db.RecordType(name="RT2").add_parent("exists").add_property("exists_property", 32453).insert()
with pytest.raises(TransactionError) as cm:
db.Record(name="RT3").add_parent("notexists").insert()
assert [e.msg for e in cm.value.errors] == ["Entity has unqualified parents."]
with pytest.raises(TransactionError) as cm:
db.Record(name="RT4").add_parent("exists").add_property("notexists", 234243).insert()
assert [e.msg for e in cm.value.errors] == ["Entity has unqualified properties."]
with pytest.raises(TransactionError) as cm:
db.Record(
name="RT5").add_parent("notexists").add_property(
"exists_property",
234243).insert()
assert [e.msg for e in cm.value.errors] == ["Entity has unqualified parents."]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment