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
Merge requests
!60
TST: Test for issue server#143.
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
TST: Test for issue server#143.
f-server-144
into
dev
Overview
3
Commits
9
Pipelines
15
Changes
4
All threads resolved!
Show all comments
Merged
Timm Fitschen
requested to merge
f-server-144
into
dev
2 years ago
Overview
3
Commits
9
Pipelines
15
Changes
4
All threads resolved!
Show all comments
Expand
Summary
Tests for
caosdb-server!90 (merged)
Edited
2 years ago
by
Timm Fitschen
0
0
Merge request reports
Compare
dev
version 6
fed9a64a
2 years ago
version 5
723e0e7a
2 years ago
version 4
b874f258
2 years ago
version 3
3e317c96
2 years ago
version 2
7cc4a4c3
2 years ago
version 1
b8feea22
2 years ago
dev (base)
and
latest version
latest version
30f980e3
9 commits,
2 years ago
version 6
fed9a64a
8 commits,
2 years ago
version 5
723e0e7a
5 commits,
2 years ago
version 4
b874f258
4 commits,
2 years ago
version 3
3e317c96
3 commits,
2 years ago
version 2
7cc4a4c3
2 commits,
2 years ago
version 1
b8feea22
1 commit,
2 years ago
4 files
+
37
−
16
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
4
Search (e.g. *.vue) (Ctrl+P)
tests/test_issues_server.py
+
28
−
8
Options
@@ -1256,19 +1256,39 @@ def test_196b(deny):
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
"
])
@pytest.mark.parametrize
(
"
num
"
,
[
"
1e+23
"
,
"
5e22
"
,
"
2e-323
"
,
"
2E-323
"
,
"
5E22
"
,
"
1E+23
"
,
"
+1E+23
"
])
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
)
for
query
in
[
f
"
FIND RECORDTYPE RT1 WITH scientific_notation=
{
num
}
"
,
f
"
FIND RECORDTYPE RT1 WITH scientific_notation=
'
{
num
}
'"
,
f
"
FIND RECORDTYPE RT1 WITH scientific_notation=
\"
{
num
}
\"
"
,
f
"
FIND RECORDTYPE RT1 WITH scientific_notation =
{
num
}
"
,
f
"
FIND RECORDTYPE RT1 WITH scientific_notation =
'
{
num
}
'"
,
f
"
FIND RECORDTYPE RT1 WITH scientific_notation =
\"
{
num
}
\"
"
]:
db
.
execute_query
(
query
,
unique
=
True
)
@pytest.mark.parametrize
(
"
num
"
,
[
"
1 e+23
"
,
"
- 5e22
"
,
"
2e -323
"
,
"
2E- 323
"
,
"
5 E 22
"
,
"
1 E+ 23
"
,
"
+ 1
"
])
def
test_143_white_space
(
num
):
"""
https://gitlab.com/caosdb/caosdb-server/-/issues/144
"""
for
query
in
[
f
"
FIND RECORDTYPE RT1 WITH scientific_notation=
{
num
}
"
,
f
"
FIND RECORDTYPE RT1 WITH scientific_notation=
'
{
num
}
'"
,
f
"
FIND RECORDTYPE RT1 WITH scientific_notation=
\"
{
num
}
\"
"
,
f
"
FIND RECORDTYPE RT1 WITH scientific_notation =
{
num
}
"
,
f
"
FIND RECORDTYPE RT1 WITH scientific_notation =
'
{
num
}
'"
,
f
"
FIND RECORDTYPE RT1 WITH scientific_notation =
\"
{
num
}
\"
"
]:
with
pytest
.
raises
(
TransactionError
)
as
cm
:
db
.
execute_query
(
query
)
assert
cm
.
value
.
msg
==
f
'
You typed
"
{
num
}
"
. Empty spaces are not allowed in numbers. Did you mean
"
{
num
.
replace
(
"
"
,
""
)
}
"
?
'
def
test_144
():
Loading