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
408e3be2
Commit
408e3be2
authored
4 years ago
by
Bert Palm
🎇
Browse files
Options
Downloads
Patches
Plain Diff
more tests
parent
908589cf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!218
Flags
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/flagger/test_backtrack.py
+61
-2
61 additions, 2 deletions
test/flagger/test_backtrack.py
with
61 additions
and
2 deletions
test/flagger/test_backtrack.py
+
61
−
2
View file @
408e3be2
...
...
@@ -114,8 +114,67 @@ def test_init_with_mask(data: np.array):
assert
is_equal
(
bt
,
fast
)
def
test_append
():
pass
@pytest.mark.parametrize
(
'
data
'
,
data
+
[
None
])
def
test_copy
(
data
):
# init
df
=
pd
.
DataFrame
(
data
,
dtype
=
float
)
bt
=
Backtrack
(
bt
=
df
)
shallow
=
bt
.
copy
(
deep
=
False
)
deep
=
bt
.
copy
(
deep
=
True
)
# checks
for
copy
in
[
deep
,
shallow
]:
check_invariants
(
copy
)
assert
copy
is
not
bt
assert
is_equal
(
copy
,
bt
)
assert
deep
is
not
shallow
assert
is_equal
(
deep
,
shallow
)
assert
deep
.
bt
is
not
bt
.
bt
assert
deep
.
mask
is
not
bt
.
mask
assert
shallow
.
bt
is
bt
.
bt
assert
shallow
.
mask
is
bt
.
mask
@pytest.fixture
(
scope
=
'
module
'
)
def
_append_bt
():
return
Backtrack
()
@pytest.mark.parametrize
(
'
s, max_val
'
,
[
(
pd
.
Series
(
val
,
index
=
range
(
6
),
dtype
=
float
),
max_val
)
for
val
,
max_val
in
zip
(
[
0
,
1
,
3
,
np
.
nan
,
2
,
1
,
0
],
[
0
,
1
,
3
,
3
,
3
,
3
,
3
]
# expected max-val
)
])
def
test_append
(
_append_bt
,
s
,
max_val
):
bt
=
_append_bt
print
(
bt
.
bt
)
bt
.
append
(
s
,
force
=
False
)
check_invariants
(
bt
)
assert
all
(
bt
.
max
()
==
max_val
)
# this test append more rows to the resulting
# BT from the former test
@pytest.mark.parametrize
(
'
s, max_val
'
,
[
(
pd
.
Series
(
val
,
index
=
range
(
6
),
dtype
=
float
),
max_val
)
for
val
,
max_val
in
zip
(
[
0
,
1
,
3
,
np
.
nan
,
2
,
1
,
0
],
[
0
,
1
,
3
,
3
,
2
,
1
,
0
],
# expected max-val
)
])
def
test_append_force
(
_append_bt
,
s
,
max_val
):
bt
=
_append_bt
print
(
bt
.
bt
)
bt
.
append
(
s
,
force
=
True
)
check_invariants
(
bt
)
assert
all
(
bt
.
max
()
==
max_val
)
def
test_squeeze
():
...
...
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