diff --git a/tests/gtfs/test_validation.py b/tests/gtfs/test_validation.py index 0d698666..27797c62 100644 --- a/tests/gtfs/test_validation.py +++ b/tests/gtfs/test_validation.py @@ -579,6 +579,8 @@ def test__plot_summary_defences(self, gtfs_fixture): """Test defences for _plot_summary().""" current_fixture = gtfs_fixture current_fixture.summarise_routes() + + # test parameters that are yet to be tested with pytest.raises( ValueError, match=re.escape( @@ -593,6 +595,7 @@ def test__plot_summary_defences(self, gtfs_fixture): orientation="l", ) + # test the ability to make a directory with pytest.raises( NotADirectoryError, match=re.escape( @@ -610,6 +613,8 @@ def test__plot_summary_on_pass(self, gtfs_fixture): """Test plotting a summary when defences are passed.""" current_fixture = gtfs_fixture current_fixture.summarise_routes() + + # test returning a html string test_html = gtfs_fixture._plot_summary( gtfs_fixture.daily_route_summary, "route_count_mean", @@ -617,6 +622,7 @@ def test__plot_summary_on_pass(self, gtfs_fixture): ) assert type(test_html) == str, "Failed to return HTML for the plot" + # test returning a plotly figure test_image = gtfs_fixture._plot_summary( gtfs_fixture.daily_route_summary, "route_count_mean" ) @@ -624,6 +630,7 @@ def test__plot_summary_on_pass(self, gtfs_fixture): type(test_image) == PlotlyFigure ), "Failed to return plotly.graph_objects.Figure type" + # test saving plots in html and png format gtfs_fixture._plot_summary( gtfs_fixture.daily_route_summary, "route_count_mean", @@ -663,6 +670,7 @@ def test__plot_summary_on_pass(self, gtfs_fixture): def test__plot_route_summary_defences(self, gtfs_fixture): """Test the defences for the small wrapper plot_route_summary().""" + # test attribute checks with pytest.raises( AttributeError, match=( @@ -676,6 +684,7 @@ def test__plot_route_summary_defences(self, gtfs_fixture): def test__plot_trip_summary_defences(self, gtfs_fixture): """Test the defences for the small wrapper plot_trip_summary().""" + # test attribute checks with pytest.raises( AttributeError, match=(