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

MAINT: clean up comments in test_issues_server.py

parent 9b42e9a5
No related branches found
No related tags found
1 merge request!12TST: add tests for caosdb-server#170
Pipeline #12848 passed
This commit is part of merge request !12. Comments created here will be created in the context of that merge request.
...@@ -263,14 +263,14 @@ def test_issue_170(): ...@@ -263,14 +263,14 @@ def test_issue_170():
"""update scalar data type to list data type""" """update scalar data type to list data type"""
p = db.Property(name="TestProp1", datatype=db.LIST(db.INTEGER)) p = db.Property(name="TestProp1", datatype=db.LIST(db.INTEGER))
p.value = [1, 2] p.value = [1, 2]
p.insert() # works p.insert()
p2 = db.execute_query("FIND TestProp1", unique=True) p2 = db.execute_query("FIND TestProp1", unique=True)
assert p2.datatype == db.LIST(db.INTEGER) assert p2.datatype == db.LIST(db.INTEGER)
assert p2.value == [1, 2] assert p2.value == [1, 2]
p.description = "TestDescription" p.description = "TestDescription"
p.update() # fails p.update() # this failed
p2 = db.execute_query("FIND TestProp1", unique=True) p2 = db.execute_query("FIND TestProp1", unique=True)
assert p2.datatype == db.LIST(db.INTEGER) assert p2.datatype == db.LIST(db.INTEGER)
...@@ -278,23 +278,26 @@ def test_issue_170(): ...@@ -278,23 +278,26 @@ def test_issue_170():
assert p2.description == "TestDescription" assert p2.description == "TestDescription"
p = db.Property(name="TestProp2", datatype=db.DOUBLE) p = db.Property(name="TestProp2", datatype=db.DOUBLE)
p.insert() # works p.insert()
p.datatype = db.LIST(db.INTEGER) p.datatype = db.LIST(db.INTEGER)
p.update() # works p.update() # this worked because no value yet
p2 = db.execute_query("FIND TestProp1", unique=True) p2 = db.execute_query("FIND TestProp2", unique=True)
assert p2.datatype == db.LIST(db.INTEGER)
p.value = [1, 2]
p.update() # this failed
p2 = db.execute_query("FIND TestProp2", unique=True)
assert p2.datatype == db.LIST(db.INTEGER) assert p2.datatype == db.LIST(db.INTEGER)
assert p2.value == [1, 2] assert p2.value == [1, 2]
p2.value = [1, 2]
p2.update() # fails
p = db.Property(name="TestProp3", datatype=db.DOUBLE) p = db.Property(name="TestProp3", datatype=db.DOUBLE)
p.insert() # works p.insert()
p.datatype = db.LIST(db.INTEGER) p.datatype = db.LIST(db.INTEGER)
p.value = [1, 2] p.value = [1, 2]
p.update() # fails p.update() # this failed
p2 = db.execute_query("FIND TestProp1", unique=True) p2 = db.execute_query("FIND TestProp3", unique=True)
assert p2.datatype == db.LIST(db.INTEGER) assert p2.datatype == db.LIST(db.INTEGER)
assert p2.value == [1, 2] assert p2.value == [1, 2]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment