Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RSE 23 Group Assignment Shervud Pitawanik Franz
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Niklas Franz
RSE 23 Group Assignment Shervud Pitawanik Franz
Commits
2a964d41
Commit
2a964d41
authored
1 year ago
by
Sortofamudkip
Browse files
Options
Downloads
Patches
Plain Diff
test_bool_or_none_params
parent
de4e8803
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/test_dataset.py
+13
-3
13 additions, 3 deletions
src/test_dataset.py
with
13 additions
and
3 deletions
src/test_dataset.py
+
13
−
3
View file @
2a964d41
...
...
@@ -91,10 +91,11 @@ def test_catch_non_dataframe(the_dataset: Dataset, param):
@pytest.mark.parametrize
(
"
param
"
,
[
"
true
"
,
"
false
"
,
"
True
"
,
"
False
"
],
[
"
true
"
,
"
false
"
,
"
True
"
,
"
False
"
,
1
,
0
,
-
1
],
)
def
test_catch_non_bool
(
the_dataset
:
Dataset
,
param
):
"""
Tests that the dataframe is preprocessed correctly.
"""
"""
Tests that functions that take bool or None correctly
catch incorrect input data types.
"""
dataframe
=
the_dataset
.
get_dataframe
()
columns_set
=
set
(
dataframe
.
columns
)
with
pytest
.
raises
(
ValueError
):
...
...
@@ -107,7 +108,16 @@ def test_catch_non_bool(the_dataset: Dataset, param):
[
True
,
False
,
None
],
)
def
test_bool_or_none_params
(
the_dataset
:
Dataset
,
param
):
"""
Tests that the dataframe is preprocessed correctly.
"""
"""
Tests that functions that take bool or None correctly
work as intended.
"""
dataframe
=
the_dataset
.
get_dataframe
()
columns_set
=
set
(
dataframe
.
columns
)
the_dataset
.
get_category_counts
(
"
GAD_T
"
,
param
)
def
test_catch_colname_not_in_df
(
the_dataset
:
Dataset
):
"""
Tests that functions that take colname correctly
catch colnames not in dataset.
"""
with
pytest
.
raises
(
KeyError
):
the_dataset
.
get_category_counts
(
"
GAAAD_T
"
)
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