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

TST: add more select tests

parent bfa0789f
No related branches found
No related tags found
No related merge requests found
Pipeline #32873 failed
......@@ -27,6 +27,7 @@
@author: tf
"""
import os
from pytest import mark, raises
import caosdb as db
......@@ -94,6 +95,10 @@ def teardown_module():
if len(d) > 0:
d.delete()
try:
os.remove("test.dat")
except Exception as e:
print(e)
def test_id1():
......@@ -576,3 +581,24 @@ def test_select_update_with_force():
# only name has been selected and updated, so no properties remain:
rec = db.Record(name=select_result.name).retrieve()
assert len(rec.properties) == 0
def test_select_path():
with open("test.dat", "w") as upload_file:
upload_file.write("hello world\n")
file_ = db.File(name="TestFile",
description="Testfile Desc",
path="testfiles/test.dat",
file="test.dat")
file_.insert()
qfile = db.execute_query("FIND FILE TestFile", unique=True)
assert qfile.path == "/testfiles/test.dat"
assert db.execute_query("SELECT path FROM FILE TestFile")[0].path == "/testfiles/test.dat"
def test_select_datatype():
p = db.Property("TestProp", datatype=db.DOUBLE).insert()
qprop = db.execute_query("FIND PROPERTY TestProp", unique=True)
assert qprop.datatype == db.DOUBLE
assert db.execute_query("SELECT datatype FROM PROPERTY TestProp")[0].datatype == db.DOUBLE
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment