diff --git a/tests/operators/test_plots.py b/tests/operators/test_plots.py index 386cb8e88..a84e10a03 100644 --- a/tests/operators/test_plots.py +++ b/tests/operators/test_plots.py @@ -255,3 +255,17 @@ def test_scatter_plot_too_many_y_dimensions( cube_x = collapse.collapse(vertical_profile_cube, ["time"], "MEAN")[0:4] with pytest.raises(ValueError): plot.scatter_plot(cube_x, cube_y) + + +def test_get_plot_resolution(tmp_working_dir): + """Test getting the plot resolution.""" + with open("meta.json", "wt", encoding="UTF-8") as fp: + fp.write('{"plot_resolution": 72}') + resolution = plot._get_plot_resolution() + assert resolution == 72 + + +def test_get_plot_resolution_unset(tmp_working_dir): + """Test getting the default plot resolution when unset.""" + resolution = plot._get_plot_resolution() + assert resolution == 100 diff --git a/tests/test_run_recipes.py b/tests/test_run_recipes.py index e7a49564a..f395e0e62 100644 --- a/tests/test_run_recipes.py +++ b/tests/test_run_recipes.py @@ -94,3 +94,11 @@ def test_run_steps_style_file_metadata_written(tmp_path: Path): with open(tmp_path / "meta.json", "rb") as fp: metadata = json.load(fp) assert metadata["style_file_path"] == style_file_path + + +def test_run_steps_plot_resolution_metadata_written(tmp_path: Path): + """Style file path metadata written out.""" + CSET.operators._run_steps({}, [], None, tmp_path, plot_resolution=72) + with open(tmp_path / "meta.json", "rb") as fp: + metadata = json.load(fp) + assert metadata["plot_resolution"] == 72