Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
CaosDB Python Integration Tests
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
CaosDB Python Integration Tests
Commits
db9fb609
Verified
Commit
db9fb609
authored
Nov 11, 2022
by
Timm Fitschen
Browse files
Options
Downloads
Patches
Plain Diff
TST: add more select tests
parent
bfa0789f
No related branches found
No related tags found
No related merge requests found
Pipeline
#32873
failed
Jan 20, 2023
Stage: info
Stage: setup
Stage: cert
Stage: style
Stage: test
Stage: deploy
Changes
1
Pipelines
78
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_select.py
+26
-0
26 additions, 0 deletions
tests/test_select.py
with
26 additions
and
0 deletions
tests/test_select.py
+
26
−
0
View file @
db9fb609
...
...
@@ -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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment