def test_plot_aggregates_save_fig(tmpdir):
    path = os.path.join(tmpdir, 'test_plot.png')
    output_plots.plot_aggregates(
        base_tpi, base_params, plot_type='levels', path=path)
    img = mpimg.imread(path)

    assert isinstance(img, np.ndarray)