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
4f7f7a71
Verified
Commit
4f7f7a71
authored
1 year ago
by
Daniel Hornung
Browse files
Options
Downloads
Patches
Plain Diff
FIX: Pandas deprecation warning.
parent
69f7b1bd
No related branches found
No related tags found
1 merge request
!74
FIX: Pandas deprecation warning.
Pipeline
#46300
failed
1 year ago
Stage: info
Stage: setup
Stage: cert
Stage: style
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_server_side_scripting.py
+29
-7
29 additions, 7 deletions
tests/test_server_side_scripting.py
with
29 additions
and
7 deletions
tests/test_server_side_scripting.py
+
29
−
7
View file @
4f7f7a71
...
...
@@ -70,6 +70,28 @@ def clean_database():
d
.
delete
()
def
assert_stderr
(
stderr
)
->
None
:
"""
Assert that ``stderr`` is either None or contains only the pyarrow deprecation warning.
This can probably removed with Pandas 3.0, to be replaced by ``assert stderr is None``.
Parameters
----------
stderr
The object to be tested.
"""
if
stderr
is
None
:
return
assert
isinstance
(
stderr
,
str
)
assert
stderr
.
split
(
sep
=
"
\n
"
,
maxsplit
=
1
)[
1
]
==
"""
Pyarrow will become a required dependency of pandas in the next major release of pandas (pandas 3.0),
(to allow more performant data types, such as the Arrow string type, and better interoperability with other libraries)
but was not found to be installed on your system.
If this would cause problems for you,
please provide us feedback at https://github.com/pandas-dev/pandas/issues/54466
i = __import__(m)
"""
def
setup_function
(
function
):
clean_database
()
...
...
@@ -148,7 +170,7 @@ def test_call_ok():
xml
=
etree
.
parse
(
r
)
assert
xml
.
xpath
(
"
/Response/script/call
"
)[
0
].
text
==
"
ok
"
assert
xml
.
xpath
(
"
/Response/script/stdout
"
)[
0
].
text
==
"
ok
"
assert
xml
.
xpath
(
"
/Response/script/stderr
"
)[
0
].
text
is
None
assert
_stderr
(
xml
.
xpath
(
"
/Response/script/stderr
"
)[
0
].
text
)
assert
xml
.
xpath
(
"
/Response/script/@code
"
)[
0
]
==
"
0
"
...
...
@@ -163,7 +185,7 @@ def test_call_err():
assert
xml
.
xpath
(
"
/Response/script/@code
"
)[
0
]
==
"
1
"
assert
xml
.
xpath
(
"
/Response/script/call
"
)[
0
].
text
==
"
err
"
assert
xml
.
xpath
(
"
/Response/script/stdout
"
)[
0
].
text
is
None
assert
xml
.
xpath
(
"
/Response/script/stderr
"
)[
0
].
text
==
"
err
"
assert
_stderr
(
xml
.
xpath
(
"
/Response/script/stderr
"
)[
0
].
text
)
def
test_run_server_side_script_with_file_as_positional_param
():
...
...
@@ -178,7 +200,7 @@ def test_run_server_side_script_with_file_as_positional_param():
exit
=
"
123
"
,
query
=
"
COUNT ENTITY TestRT
"
,
files
=
{
"
-p2
"
:
"
test_file.txt
"
})
assert
response
.
stderr
is
None
assert
_stderr
(
response
.
stderr
)
assert
response
.
code
==
123
assert
response
.
call
==
(
'
administration/diagnostics.py
'
'
--exit=123 --query=COUNT ENTITY TestRT
'
...
...
@@ -203,7 +225,7 @@ def test_run_server_side_script_with_additional_file():
exit
=
"
123
"
,
query
=
"
COUNT ENTITY TestRT
"
,
files
=
{
"
dummykey
"
:
"
test_file.txt
"
})
assert
response
.
stderr
is
None
assert
_stderr
(
response
.
stderr
)
assert
response
.
code
==
123
assert
response
.
call
==
(
'
administration/diagnostics.py
'
'
--exit=123 --query=COUNT ENTITY TestRT
'
...
...
@@ -250,7 +272,7 @@ def test_diagnostics_basic():
"
with code 123.
"
)
assert
xml
.
xpath
(
"
/Response/script/call
"
)[
0
].
text
.
startswith
(
"
administration/diagnostics.py
"
)
assert
xml
.
xpath
(
"
/Response/script/stderr
"
)[
0
].
text
is
None
assert
_stderr
(
xml
.
xpath
(
"
/Response/script/stderr
"
)[
0
].
text
)
def
test_diagnostics_with_file_upload
():
...
...
@@ -293,7 +315,7 @@ def test_diagnostics_with_file_upload():
"
with code 0.
"
)
assert
xml
.
xpath
(
"
/Response/script/call
"
)[
0
].
text
.
startswith
(
"
administration/diagnostics.py
"
)
assert
xml
.
xpath
(
"
/Response/script/stderr
"
)[
0
].
text
is
None
assert
_stderr
(
xml
.
xpath
(
"
/Response/script/stderr
"
)[
0
].
text
)
@mark.local_server
...
...
@@ -403,7 +425,7 @@ def test_anonymous_script_calling_success():
assert
xml
.
xpath
(
"
/Response/UserInfo/Roles/Role
"
)[
0
].
text
==
"
anonymous
"
assert
xml
.
xpath
(
"
/Response/script/call
"
)[
0
].
text
==
"
ok_anonymous
"
assert
xml
.
xpath
(
"
/Response/script/stdout
"
)[
0
].
text
==
"
ok_anonymous
"
assert
xml
.
xpath
(
"
/Response/script/stderr
"
)[
0
].
text
is
None
assert
_stderr
(
xml
.
xpath
(
"
/Response/script/stderr
"
)[
0
].
text
)
assert
xml
.
xpath
(
"
/Response/script/@code
"
)[
0
]
==
"
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