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
9b510313
Commit
9b510313
authored
2 years ago
by
Timm Fitschen
Browse files
Options
Downloads
Plain Diff
Merge branch 'dev' into 'f-transaction-permissions'
# Conflicts: # tests/test_issues_server.py
parents
29bfa957
e1a6232b
No related branches found
No related tags found
1 merge request
!56
TST: issue caosdb-server#196.
Pipeline
#35183
passed with warnings
2 years ago
Stage: info
Stage: setup
Stage: cert
Stage: style
Stage: test
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_issues_server.py
+50
-0
50 additions, 0 deletions
tests/test_issues_server.py
with
50 additions
and
0 deletions
tests/test_issues_server.py
+
50
−
0
View file @
9b510313
...
@@ -1254,3 +1254,53 @@ def test_196b(deny):
...
@@ -1254,3 +1254,53 @@ def test_196b(deny):
# this should fail because the curator doesn't have TRANSACTION:INSERT:PROPERTY
# this should fail because the curator doesn't have TRANSACTION:INSERT:PROPERTY
db
.
Property
(
name
=
"
TestProp2
"
,
datatype
=
db
.
TEXT
).
insert
()
db
.
Property
(
name
=
"
TestProp2
"
,
datatype
=
db
.
TEXT
).
insert
()
assert
cm
.
value
.
errors
[
0
].
msg
==
"
You are not allowed to do this.
"
assert
cm
.
value
.
errors
[
0
].
msg
==
"
You are not allowed to do this.
"
@pytest.mark.xfail
(
reason
=
"
fix needed
"
)
@pytest.mark.parametrize
(
"
num
"
,
[
"
1e+23
"
,
"
5e22
"
,
"
2e-323
"
])
def
test_143
(
num
):
"""
https://gitlab.com/caosdb/caosdb-server/-/issues/144
"""
db
.
Property
(
name
=
"
scientific_notation
"
,
datatype
=
db
.
DOUBLE
).
insert
()
db
.
RecordType
(
name
=
"
RT1
"
).
add_property
(
"
scientific_notation
"
,
value
=
num
).
insert
()
db
.
execute_query
(
f
"
FIND RECORDTYPE RT1 WITH scientific_notation=
{
num
}
"
,
unique
=
True
)
db
.
execute_query
(
f
"
FIND RECORDTYPE RT1 WITH scientific_notation=
'
{
num
}
'"
,
unique
=
True
)
db
.
execute_query
(
f
"
FIND RECORDTYPE RT1 WITH scientific_notation=
\"
{
num
}
\"
"
,
unique
=
True
)
db
.
execute_query
(
f
"
FIND RECORDTYPE RT1 WITH scientific_notation =
{
num
}
"
,
unique
=
True
)
db
.
execute_query
(
f
"
FIND RECORDTYPE RT1 WITH scientific_notation =
'
{
num
}
'"
,
unique
=
True
)
db
.
execute_query
(
f
"
FIND RECORDTYPE RT1 WITH scientific_notation =
\"
{
num
}
\"
"
,
unique
=
True
)
def
test_144
():
"""
https://gitlab.com/caosdb/caosdb-server/-/issues/144
"""
db
.
Property
(
name
=
"
scientific_notation
"
,
datatype
=
db
.
DOUBLE
,
value
=
"
1e23
"
).
insert
()
value
=
db
.
execute_query
(
"
FIND PROPERTY scientific_notation
"
,
unique
=
True
).
value
assert
str
(
value
)
==
"
1e+23
"
assert
isinstance
(
value
,
float
)
assert
value
==
1e23
assert
value
==
1e+23
def
test_166
():
"""
https://gitlab.com/caosdb/caosdb-server/-/issues/166
"""
db
.
RecordType
(
name
=
"
exists
"
).
insert
()
db
.
Property
(
name
=
"
exists_property
"
,
datatype
=
db
.
INTEGER
).
insert
()
db
.
RecordType
(
name
=
"
RT1
"
).
add_parent
(
"
exists
"
).
insert
()
db
.
RecordType
(
name
=
"
RT2
"
).
add_parent
(
"
exists
"
).
add_property
(
"
exists_property
"
,
32453
).
insert
()
with
pytest
.
raises
(
TransactionError
)
as
cm
:
db
.
Record
(
name
=
"
RT3
"
).
add_parent
(
"
notexists
"
).
insert
()
assert
[
e
.
msg
for
e
in
cm
.
value
.
errors
]
==
[
"
Entity has unqualified parents.
"
]
with
pytest
.
raises
(
TransactionError
)
as
cm
:
db
.
Record
(
name
=
"
RT4
"
).
add_parent
(
"
exists
"
).
add_property
(
"
notexists
"
,
234243
).
insert
()
assert
[
e
.
msg
for
e
in
cm
.
value
.
errors
]
==
[
"
Entity has unqualified properties.
"
]
with
pytest
.
raises
(
TransactionError
)
as
cm
:
db
.
Record
(
name
=
"
RT5
"
).
add_parent
(
"
notexists
"
).
add_property
(
"
exists_property
"
,
234243
).
insert
()
assert
[
e
.
msg
for
e
in
cm
.
value
.
errors
]
==
[
"
Entity has unqualified parents.
"
]
\ No newline at end of file
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