Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SaQC
Manage
Activity
Members
Labels
Plan
Issues
36
Issue boards
Milestones
Wiki
Code
Merge requests
8
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
rdm-software
SaQC
Commits
df0ea54e
Commit
df0ea54e
authored
2 years ago
by
Bert Palm
🎇
Browse files
Options
Downloads
Patches
Plain Diff
added tests for xxxSequence from tools
parent
12561ee8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!462
More tests
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/lib/test_tools.py
+40
-0
40 additions, 0 deletions
tests/lib/test_tools.py
with
40 additions
and
0 deletions
tests/lib/test_tools.py
0 → 100644
+
40
−
0
View file @
df0ea54e
# SPDX-FileCopyrightText: 2021 Helmholtz-Zentrum für Umweltforschung GmbH - UFZ
#
# SPDX-License-Identifier: GPL-3.0-or-later
import
pytest
import
saqc.lib.tools
as
tools
import
pandas
as
pd
import
numpy
as
np
class
_ListLike
(
list
):
pass
@pytest.mark.parametrize
(
'
value,expected
'
,
[
(
None
,
[
None
]),
([
None
],
[
None
]),
(
1
,
[
1
]),
(
np
.
nan
,
[
np
.
nan
]),
([
1
],
[
1
]),
(
'
foo
'
,
[
'
foo
'
]),
([
'
foo
'
],
[
'
foo
'
]),
([
1
,
2
],
[
1
,
2
]),
(
_ListLike
(
"
ab
"
),
[
'
a
'
,
'
b
'
])
])
def
test_toSequence
(
value
,
expected
):
result
=
tools
.
toSequence
(
value
)
assert
isinstance
(
result
,
list
)
assert
result
==
expected
@pytest.mark.parametrize
(
'
value,expected
'
,
[
([
1
],
1
),
([[]],
[]),
([[
1
,
2
]],
[
1
,
2
]),
(
_ListLike
(
'
a
'
),
'
a
'
)
])
def
test_squeezeSequence
(
value
,
expected
):
result
=
tools
.
squeezeSequence
(
value
)
assert
result
==
expected
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