diff --git a/.coverage b/.coverage index c63ebc4625ea65bb7e2925481b98b8f4036efd59..79d0a9dc4438303df4354b7f7e0d25d4aa2e31ef 100644 Binary files a/.coverage and b/.coverage differ diff --git a/src/test_dataset.py b/src/test_dataset.py index 97cad41e669712c9f6cc96d1a0fda3e99b2b71fa..87d66df7520e34c29d51cdab50eecfe5d1580823 100644 --- a/src/test_dataset.py +++ b/src/test_dataset.py @@ -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) diff --git a/src/test_plotter.py b/src/test_plotter.py index 75441fca070aefd405cf817240b7ff8b9947b322..daf8bdc3051c391154c0286e0f39e41243c8832c 100644 --- a/src/test_plotter.py +++ b/src/test_plotter.py @@ -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