diff --git a/pyproject.toml b/pyproject.toml index b6c9271..065a452 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,6 +33,7 @@ dev = [ "pylint", # Used for static linting of files "pytest", "pytest-cov", # Used to report total code coverage + "pytest-mock", # Used to mock objects in tests ] [build-system] diff --git a/tests/hipscat/inspection/test_visualize_catalog_cloud.py b/tests/hipscat/inspection/test_visualize_catalog_cloud.py index aeee397..cde7068 100644 --- a/tests/hipscat/inspection/test_visualize_catalog_cloud.py +++ b/tests/hipscat/inspection/test_visualize_catalog_cloud.py @@ -1,9 +1,18 @@ +import healpy as hp from hipscat.catalog import Catalog from hipscat.inspection import plot_pixels, plot_points +# pylint: disable=no-member -def test_generate_map_order1(small_sky_dir_cloud, example_cloud_storage_options): + +def test_generate_map_order1(small_sky_dir_cloud, example_cloud_storage_options, mocker): """Basic test that map data can be generated (does not test that a plot is rendered)""" cat = Catalog.read_from_hipscat(small_sky_dir_cloud, storage_options=example_cloud_storage_options) - plot_pixels(cat, draw_map=False) - plot_points(cat, draw_map=False) + + mocker.patch("healpy.mollview") + plot_pixels(cat) + hp.mollview.assert_called_once() + + hp.mollview.reset_mock() + plot_points(cat) + hp.mollview.assert_called_once()