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
e46929fb
Commit
e46929fb
authored
1 year ago
by
Sortofamudkip
Browse files
Options
Downloads
Patches
Plain Diff
more Plotter.py tests
parent
d20de04f
Loading
Loading
1 merge request
!12
Merge "Write tests" branch into master
This commit is part of merge request
!12
. Comments created here will be created in the context of that merge request.
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/test_plotter.py
+15
-1
15 additions, 1 deletion
src/test_plotter.py
with
15 additions
and
1 deletion
src/test_plotter.py
+
15
−
1
Edit
View file @
e46929fb
...
@@ -5,6 +5,7 @@ from Plotter import Plotter
...
@@ -5,6 +5,7 @@ from Plotter import Plotter
import
pandas
as
pd
import
pandas
as
pd
import
pytest
import
pytest
import
matplotlib.pyplot
as
plt
this_file_dir
=
Path
(
__file__
).
parent
this_file_dir
=
Path
(
__file__
).
parent
...
@@ -46,7 +47,20 @@ def test_catch_styling_params_not_dict(the_plotter: Plotter, param):
...
@@ -46,7 +47,20 @@ def test_catch_styling_params_not_dict(the_plotter: Plotter, param):
"""
Tests that functions that take styling_params correctly
"""
Tests that functions that take styling_params correctly
catch non dictionaries.
"""
catch non dictionaries.
"""
with
pytest
.
raises
(
ValueError
):
with
pytest
.
raises
(
ValueError
):
the_plotter
.
distribution_plot
(
"
GAD_T
"
,
param
)
the_plotter
.
plot_categorical_bar_chart
(
"
GAD_T
"
,
"
GAD_T
"
,
param
)
the_plotter
.
plot_categorical_bar_chart
(
"
GAD_T
"
,
"
GAD_T
"
,
param
)
with
pytest
.
raises
(
ValueError
):
the_plotter
.
plot_categorical_histplot
(
"
GAD_T
"
,
"
GAD_T
"
,
param
)
the_plotter
.
plot_categorical_histplot
(
"
GAD_T
"
,
"
GAD_T
"
,
param
)
with
pytest
.
raises
(
ValueError
):
the_plotter
.
plot_scatterplot
(
"
GAD_T
"
,
"
GAD_T
"
,
param
)
the_plotter
.
plot_scatterplot
(
"
GAD_T
"
,
"
GAD_T
"
,
param
)
def
test_catch_plotter_init_not_Dataset
():
"""
Tests that the Plotter
'
s init actually takes a Dataset.
"""
with
pytest
.
raises
(
ValueError
):
p
=
Plotter
(
"
not-a-Dataset
"
)
def
test_customize_plot
(
the_plotter
:
Plotter
):
fig
,
ax
=
plt
.
subplots
()
the_plotter
.
customize_plot
(
fig
,
ax
,
{
"
title
"
:
"
a
"
})
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