Skip to content
Snippets Groups Projects
Commit 3e3324b0 authored by Sortofamudkip's avatar Sortofamudkip
Browse files

fixed tests to give 100% code coverage

parent 50a207b5
No related branches found
No related tags found
No related merge requests found
No preview for this file type
......@@ -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)
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment