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
5b6cd800
Verified
Commit
5b6cd800
authored
3 years ago
by
Timm Fitschen
Browse files
Options
Downloads
Patches
Plain Diff
STY: autopep'ed test_issues_server
parent
1b67f748
No related branches found
No related tags found
1 merge request
!26
pipeline
Pipeline
#19039
failed
3 years ago
Stage: setup
Stage: cert
Stage: style
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_issues_server.py
+38
-26
38 additions, 26 deletions
tests/test_issues_server.py
with
38 additions
and
26 deletions
tests/test_issues_server.py
+
38
−
26
View file @
5b6cd800
...
...
@@ -475,7 +475,9 @@ def test_issue_130():
db
.
RecordType
(
name
=
"
TestRT_A
"
).
insert
()
r1
=
db
.
Record
(
"
ReferencedRecord
"
).
add_parent
(
"
TestRT_A
"
).
insert
()
p1
=
db
.
Property
(
name
=
"
TestWrapper
"
,
datatype
=
"
TestRT_A
"
).
insert
()
p2
=
db
.
Property
(
name
=
"
TestWrapper With Spaces
"
,
datatype
=
"
TestRT_A
"
).
insert
()
p2
=
db
.
Property
(
name
=
"
TestWrapper With Spaces
"
,
datatype
=
"
TestRT_A
"
).
insert
()
db
.
RecordType
(
name
=
"
TestRT_B
"
).
add_property
(
name
=
"
TestWrapper
"
).
add_property
(
"
TestWrapper With Spaces
"
...
...
@@ -486,7 +488,6 @@ def test_issue_130():
value
=
r1
).
insert
()
query
=
"
SELECT TestWrapper FROM RECORD TestRT_B
"
row
=
db
.
execute_query
(
query
).
get_property_values
((
"
TestWrapper
"
))
assert
row
==
[(
r1
.
id
,)]
...
...
@@ -516,31 +517,39 @@ def test_issue_130():
assert
row
==
[(
"
ReferencedRecord
"
,)]
# FAILS
query
=
"
SELECT TestWrapper With Spaces FROM RECORD TestRT_B
"
row
=
db
.
execute_query
(
query
).
get_property_values
((
"
TestWrapper With Spaces
"
))
row
=
db
.
execute_query
(
query
).
get_property_values
(
(
"
TestWrapper With Spaces
"
))
assert
row
==
[(
r1
.
id
,)]
query
=
"
SELECT TestWrapper With Spaces FROM RECORD TestRT_B
"
row
=
db
.
execute_query
(
query
).
get_property_values
((
"
TestWrapper With Spaces
"
,
"
id
"
))
row
=
db
.
execute_query
(
query
).
get_property_values
(
(
"
TestWrapper With Spaces
"
,
"
id
"
))
assert
row
==
[(
p2
.
id
,)]
query
=
'
SELECT TestWrapper With Spaces FROM RECORD TestRT_B
'
row
=
db
.
execute_query
(
query
).
get_property_values
((
"
TestWrapper With Spaces
"
,
"
name
"
))
row
=
db
.
execute_query
(
query
).
get_property_values
(
(
"
TestWrapper With Spaces
"
,
"
name
"
))
assert
row
==
[(
"
TestWrapper With Spaces
"
,)]
query
=
'
SELECT
"
TestWrapper With Spaces
"
FROM RECORD TestRT_B
'
row
=
db
.
execute_query
(
query
).
get_property_values
((
"
TestWrapper With Spaces
"
,
"
name
"
))
row
=
db
.
execute_query
(
query
).
get_property_values
(
(
"
TestWrapper With Spaces
"
,
"
name
"
))
assert
row
==
[(
"
ReferencedRecord
"
,)]
# FAILS
query
=
'
SELECT TestWrapper With Spaces.name FROM RECORD TestRT_B
'
row
=
db
.
execute_query
(
query
).
get_property_values
((
"
TestWrapper With Spaces
"
,
"
name
"
))
assert
row
==
[(
"
ReferencedRecord
"
,)]
#Works!!! This is about the quotation marks
row
=
db
.
execute_query
(
query
).
get_property_values
(
(
"
TestWrapper With Spaces
"
,
"
name
"
))
# Works!!! This is about the quotation marks
assert
row
==
[(
"
ReferencedRecord
"
,)]
query
=
'
SELECT
"
TestWrapper With Spaces.name
"
FROM RECORD TestRT_B
'
row
=
db
.
execute_query
(
query
).
get_property_values
((
"
TestWrapper With Spaces
"
,
"
name
"
))
row
=
db
.
execute_query
(
query
).
get_property_values
(
(
"
TestWrapper With Spaces
"
,
"
name
"
))
assert
row
==
[(
"
ReferencedRecord
"
,)]
# FAILS
query
=
'
SELECT
"
TestWrapper With Spaces
"
.name FROM RECORD TestRT_B
'
row
=
db
.
execute_query
(
query
).
get_property_values
((
"
TestWrapper With Spaces
"
,
"
name
"
))
row
=
db
.
execute_query
(
query
).
get_property_values
(
(
"
TestWrapper With Spaces
"
,
"
name
"
))
assert
row
==
[(
"
ReferencedRecord
"
,)]
# FAILS
...
...
@@ -554,8 +563,12 @@ def test_issue_132():
db
.
Property
(
"
TestP_Bar
"
,
datatype
=
db
.
TEXT
).
insert
()
db
.
Property
(
"
TestP_Baz
"
,
datatype
=
db
.
TEXT
).
insert
()
rt1
=
db
.
Record
().
add_parent
(
"
TestRT_Foo
"
).
add_property
(
"
TestP_Bar
"
,
"
val1
"
).
add_property
(
"
TestP_Baz
"
,
"
the other baz
"
).
insert
()
rt2
=
db
.
Record
().
add_parent
(
"
TestRT
"
).
add_property
(
"
TestP_Baz
"
,
"
val2
"
).
add_property
(
"
TestRT_Foo
"
,
rt1
).
insert
()
rt1
=
db
.
Record
().
add_parent
(
"
TestRT_Foo
"
).
add_property
(
"
TestP_Bar
"
,
"
val1
"
).
add_property
(
"
TestP_Baz
"
,
"
the other baz
"
).
insert
()
rt2
=
db
.
Record
().
add_parent
(
"
TestRT
"
).
add_property
(
"
TestP_Baz
"
,
"
val2
"
).
add_property
(
"
TestRT_Foo
"
,
rt1
).
insert
()
query
=
"
FIND RECORD TestRT_Foo
"
assert
db
.
execute_query
(
query
,
unique
=
True
).
id
==
rt1
.
id
...
...
@@ -590,4 +603,3 @@ def test_issue_132():
# this one has the wront scope of the conjunction.
query
=
"
FIND RECORD TestRT WITH TestRT_Foo.TestP_Bar = val1 AND TestP_Baz =
'
the other one
'"
assert
len
(
db
.
execute_query
(
query
))
==
0
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