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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
CaosDB Python Integration Tests
Commits
086c7587
Commit
086c7587
authored
2 years ago
by
Florian Spreckelsen
Browse files
Options
Downloads
Plain Diff
Merge branch 'f-query-property-existence-by-name' into 'dev'
Test for issue
caosdb-server#192
See merge request
!55
parents
a01754fb
02e66dfb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!55
Test for issue caosdb-server#192
Pipeline
#34595
passed
2 years ago
Stage: info
Stage: setup
Stage: cert
Stage: style
Stage: test
Stage: deploy
Changes
2
Pipelines
70
Hide 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
+42
-0
42 additions, 0 deletions
tests/test_issues_server.py
with
43 additions
and
0 deletions
CHANGELOG.md
+
1
−
0
View file @
086c7587
...
...
@@ -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
)
*
Tests for
[
caosdb-pylib#90
](
https://gitlab.com/caosdb/caosdb-pylib/-/issues/90
)
:
`Entity.get_parents_recursively()`
did not work for unretrieved
parents.
*
Test for
[
caosdb-server#192
](
https://gitlab.com/caosdb/caosdb-server/-/issues/192
)
### Changed (for changes in existing functionality)
...
...
This diff is collapsed.
Click to expand it.
tests/test_issues_server.py
+
42
−
0
View file @
086c7587
...
...
@@ -1134,3 +1134,45 @@ def test_135():
r1
=
db
.
Record
().
add_parent
(
"
TestRT1
"
).
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
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 A testprop
"
query3
=
"
COUNT RECORD WHICH HAS Property testprop
"
query4
=
"
COUNT RECORD WHICH HAS A Property testprop
"
query5
=
"
COUNT RECORD WITH testprop
"
query6
=
"
COUNT RECORD WITH A testprop
"
query7
=
"
COUNT RECORD WITH Property testprop
"
query8
=
"
COUNT RECORD WITH A Property testprop
"
count1
=
db
.
execute_query
(
query1
)
count2
=
db
.
execute_query
(
query2
)
count3
=
db
.
execute_query
(
query3
)
count4
=
db
.
execute_query
(
query4
)
count5
=
db
.
execute_query
(
query5
)
count6
=
db
.
execute_query
(
query6
)
count7
=
db
.
execute_query
(
query7
)
count8
=
db
.
execute_query
(
query8
)
assert
count1
==
1
assert
count2
==
1
assert
count3
==
1
assert
count4
==
1
assert
count5
==
1
assert
count6
==
1
assert
count7
==
1
assert
count8
==
1
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