def test_input_df_without_rows(): """ Comparison dataframe has no rows """ try: comparison_viz(comparison=df.drop([0, 1, 2, 3]), choice='time') except (ValueError): assert True
def test_input_comparison_type(): """ Testing for entering an invalid type for choice. """ try: comparison_viz(comparison=3, choice='time') except (TypeError): assert True
def test_input_comparison_value(): """ Testing for entering an invalid dataframe as a comparison. """ try: comparison_viz(comparison=df[['Models', 'Variance']], choice='time') except (ValueError): assert True
def test_input_choice_value(): """ Testing for entering an invalid string as a choice. """ try: comparison_viz(comparison=df, choice='model') except (ValueError): assert True
def test_input_df_model_column_not_string(): """ Comparison dataframe model column not string """ try: df['Models'] = 1 comparison_viz(comparison=df, choice='time') except (TypeError): assert True
def test_input_df_other_columns_not_float(): """ Comparison dataframe other columns not float """ try: df['Variance'] = "a" comparison_viz(comparison=df, choice='time') except (TypeError): assert True
def test_output_comparison_viz_accuracy(): """ Testing for output from appropriate comprison dataframe and choice. """ comparison_viz(comparison=df, choice='accuracy') assert "comparison.png" in os.listdir()