Skip to content

Commit

Permalink
Update plotting method testing. (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
delucchi-cmu authored Mar 14, 2024
1 parent f26c198 commit 2a35ae8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
15 changes: 12 additions & 3 deletions tests/hipscat/inspection/test_visualize_catalog_cloud.py
Original file line number Diff line number Diff line change
@@ -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()

0 comments on commit 2a35ae8

Please sign in to comment.