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
2a794bd3
Verified
Commit
2a794bd3
authored
Feb 27, 2023
by
Daniel Hornung
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Test for issue
caosdb-server#192
.
Testing queries with Property by name.
parent
a01754fb
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!55
Test for issue caosdb-server#192
Pipeline
#34111
failed
Feb 27, 2023
Stage: info
Stage: setup
Stage: cert
Stage: style
Stage: test
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.md
+1
-0
1 addition, 0 deletions
CHANGELOG.md
tests/test_issues_server.py
+30
-0
30 additions, 0 deletions
tests/test_issues_server.py
with
31 additions
and
0 deletions
CHANGELOG.md
+
1
−
0
View file @
2a794bd3
...
@@ -43,6 +43,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
...
@@ -43,6 +43,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
*
Test for
[
caosdb-server#145
](
https://gitlab.com/caosdb/caosdb-server/-/issues/145
)
*
Test for
[
caosdb-server#145
](
https://gitlab.com/caosdb/caosdb-server/-/issues/145
)
*
Tests for
[
caosdb-pylib#90
](
https://gitlab.com/caosdb/caosdb-pylib/-/issues/90
)
:
`Entity.get_parents_recursively()`
did not work for unretrieved
*
Tests for
[
caosdb-pylib#90
](
https://gitlab.com/caosdb/caosdb-pylib/-/issues/90
)
:
`Entity.get_parents_recursively()`
did not work for unretrieved
parents.
parents.
*
Test for
[
caosdb-server#192
](
https://gitlab.com/caosdb/caosdb-server/-/issues/192
)
### Changed (for changes in existing functionality)
### Changed (for changes in existing functionality)
...
...
This diff is collapsed.
Click to expand it.
tests/test_issues_server.py
+
30
−
0
View file @
2a794bd3
...
@@ -1134,3 +1134,33 @@ def test_135():
...
@@ -1134,3 +1134,33 @@ def test_135():
r1
=
db
.
Record
().
add_parent
(
"
TestRT1
"
).
insert
()
r1
=
db
.
Record
().
add_parent
(
"
TestRT1
"
).
insert
()
r2
=
db
.
Record
().
add_parent
(
"
TestRT1
"
).
add_property
(
"
TestProp
"
,
r1
).
insert
()
r2
=
db
.
Record
().
add_parent
(
"
TestRT1
"
).
add_property
(
"
TestProp
"
,
r1
).
insert
()
assert
len
(
db
.
execute_query
(
"
FIND ENTITY WHICH IS REFERENCED BY A TestRT1 AS TestProp
"
))
==
1
assert
len
(
db
.
execute_query
(
"
FIND ENTITY WHICH IS REFERENCED BY A TestRT1 AS TestProp
"
))
==
1
def
test_192
():
"""
Testing queries with Property by name.
See https://gitlab.com/caosdb/caosdb-server/-/issues/192
COUNT Record WHICH HAS price -> Results: 19
COUNT Record WHICH HAS Property price -> Results: 19
COUNT Record WITH price -> Results: 19
COUNT Record WITH Property price -> Results: 0
"""
db
.
Property
(
name
=
"
testprop
"
,
datatype
=
db
.
DOUBLE
).
insert
()
db
.
RecordType
(
name
=
"
TestRT
"
).
add_property
(
"
testprop
"
).
insert
()
db
.
Record
(
name
=
"
Rec1
"
).
add_parent
(
"
TestRT
"
).
add_property
(
"
testprop
"
,
value
=
3.1
).
insert
()
query1
=
"
COUNT Record WHICH HAS testprop
"
query2
=
"
COUNT Record WHICH HAS Property testprop
"
query3
=
"
COUNT Record WITH testprop
"
query4
=
"
COUNT Record WITH Property testprop
"
count1
=
db
.
execute_query
(
query1
)
count2
=
db
.
execute_query
(
query2
)
count3
=
db
.
execute_query
(
query3
)
count4
=
db
.
execute_query
(
query4
)
assert
count1
==
1
assert
count2
==
1
assert
count3
==
1
assert
count4
==
1
This diff is collapsed.
Click to expand it.
Daniel Hornung
@daniel
mentioned in issue
caosdb-server#277 (closed)
·
Feb 27, 2023
mentioned in issue
caosdb-server#277 (closed)
mentioned in issue caosdb-server#277
Toggle commit list
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