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
3e3324b0
Commit
3e3324b0
authored
1 year ago
by
Sortofamudkip
Browse files
Options
Downloads
Patches
Plain Diff
fixed tests to give 100% code coverage
parent
50a207b5
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.coverage
+0
-0
0 additions, 0 deletions
.coverage
src/test_dataset.py
+7
-0
7 additions, 0 deletions
src/test_dataset.py
src/test_plotter.py
+13
-13
13 additions, 13 deletions
src/test_plotter.py
with
20 additions
and
13 deletions
.coverage
+
0
−
0
View file @
3e3324b0
No preview for this file type
This diff is collapsed.
Click to expand it.
src/test_dataset.py
+
7
−
0
View file @
3e3324b0
...
...
@@ -100,6 +100,8 @@ def test_catch_non_dataframe(the_dataset: Dataset, param):
the_dataset
.
get_combined_anxiety_score
(
param
)
with
pytest
.
raises
(
ValueError
):
the_dataset
.
get_is_narcissist_col
(
param
)
with
pytest
.
raises
(
ValueError
):
the_dataset
.
treat_outliers
(
True
,
"
GAD_T
"
)
@pytest.mark.parametrize
(
...
...
@@ -138,6 +140,9 @@ def test_catch_colname_not_in_df(the_dataset: Dataset):
with
pytest
.
raises
(
KeyError
):
the_dataset
.
get_sorted_column
(
"
GAAAD_T
"
)
with
pytest
.
raises
(
KeyError
):
the_dataset
.
treat_outliers
(
the_dataset
.
get_dataframe
(),
"
GAAAD_T
"
)
def
test_catch_colname_not_string
(
the_dataset
:
Dataset
):
"""
Tests that functions that take colname correctly
...
...
@@ -148,3 +153,5 @@ def test_catch_colname_not_string(the_dataset: Dataset):
the_dataset
.
get_sorted_column
(
True
)
with
pytest
.
raises
(
ValueError
):
the_dataset
.
get_unique_column_values
(
True
)
with
pytest
.
raises
(
ValueError
):
the_dataset
.
treat_outliers
(
the_dataset
.
get_dataframe
(),
True
)
This diff is collapsed.
Click to expand it.
src/test_plotter.py
+
13
−
13
View file @
3e3324b0
...
...
@@ -34,6 +34,18 @@ def test_catch_colname_not_in_df(the_plotter: Plotter):
catch colnames not in dataset.
"""
with
pytest
.
raises
(
KeyError
):
the_plotter
.
distribution_plot
(
"
GAAAD_T
"
)
with
pytest
.
raises
(
KeyError
):
the_plotter
.
plot_categorical_bar_chart
(
"
bad_col
"
,
"
GAD_T
"
)
with
pytest
.
raises
(
KeyError
):
the_plotter
.
plot_categorical_bar_chart
(
"
GAD_T
"
,
"
bad_col
"
)
with
pytest
.
raises
(
KeyError
):
the_plotter
.
plot_categorical_histplot
(
"
bad_col
"
,
"
GAD_T
"
)
with
pytest
.
raises
(
KeyError
):
the_plotter
.
plot_categorical_histplot
(
"
GAD_T
"
,
"
bad_col
"
)
with
pytest
.
raises
(
KeyError
):
the_plotter
.
plot_scatterplot
(
"
bad_col
"
,
"
GAD_T
"
)
with
pytest
.
raises
(
KeyError
):
the_plotter
.
plot_scatterplot
(
"
GAD_T
"
,
"
bad_col
"
)
def
test_catch_target_not_string
(
the_plotter
:
Plotter
):
...
...
@@ -46,28 +58,16 @@ def test_catch_target_not_string(the_plotter: Plotter):
the_plotter
.
plot_categorical_bar_chart
(
True
,
"
GAD_T
"
)
with
pytest
.
raises
(
ValueError
):
the_plotter
.
plot_categorical_bar_chart
(
"
GAD_T
"
,
True
)
with
pytest
.
raises
(
ValueError
):
the_plotter
.
plot_categorical_bar_chart
(
"
GAD_TT
"
,
"
GAD_T
"
)
with
pytest
.
raises
(
ValueError
):
the_plotter
.
plot_categorical_bar_chart
(
"
GAD_T
"
,
"
GAD_TT
"
)
with
pytest
.
raises
(
ValueError
):
the_plotter
.
plot_categorical_histplot
(
True
,
"
GAD_T
"
)
with
pytest
.
raises
(
ValueError
):
the_plotter
.
plot_categorical_histplot
(
"
GAD_T
"
,
True
)
with
pytest
.
raises
(
ValueError
):
the_plotter
.
plot_categorical_histplot
(
"
GAD_TT
"
,
"
GAD_T
"
)
with
pytest
.
raises
(
ValueError
):
the_plotter
.
plot_categorical_histplot
(
"
GAD_T
"
,
"
GAD_TT
"
)
with
pytest
.
raises
(
ValueError
):
the_plotter
.
plot_scatterplot
(
True
,
"
GAD_T
"
)
with
pytest
.
raises
(
ValueError
):
the_plotter
.
plot_scatterplot
(
"
GAD_T
"
,
True
)
with
pytest
.
raises
(
ValueError
):
the_plotter
.
plot_scatterplot
(
"
GAD_TT
"
,
"
GAD_T
"
)
with
pytest
.
raises
(
ValueError
):
the_plotter
.
plot_scatterplot
(
"
GAD_T
"
,
"
GAD_TT
"
)
@pytest.mark.parametrize
(
...
...
@@ -105,7 +105,7 @@ def test_distribution_plot(the_plotter: Plotter):
def
test_plot_categorical_bar_chart
(
the_plotter
:
Plotter
):
the_plotter
.
plot_categorical_bar_chart
(
"
GAD_T
"
,
"
SWL_T
"
)
the_plotter
.
plot_categorical_bar_chart
(
"
whyplay
"
,
"
SWL_T
"
)
assert
True
...
...
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