Skip to content

Commit

Permalink
refactor: Added type hints and docstrings to helper functions. Remove…
Browse files Browse the repository at this point in the history
…d unused helper functions
  • Loading branch information
pabloitu committed Aug 23, 2024
1 parent b88a590 commit c75f3bd
Showing 1 changed file with 31 additions and 30 deletions.
61 changes: 31 additions & 30 deletions tests/test_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -724,36 +724,36 @@ def test_plot_basemap_with_features(self, mock_get_basemap):
self.assertIsInstance(ax, plt.Axes)
mock_get_basemap.assert_not_called()
self.assertTrue(ax.get_legend() is None)
#
# @unittest.skipIf(is_github_ci(), "Skipping test in GitHub CI environment")
# @unittest.skipIf(not is_internet_available(), "Skipping test due to no internet connection")
# def test_plot_google_satellite(self):
# basemap = "google-satellite"
# ax = plot_basemap(
# basemap=basemap,
# extent=self.chiloe_extent,
# coastline=True,
# tile_depth=4,
# show=show_plots,
# )
# self.assertIsInstance(ax, plt.Axes)
# self.assertTrue(ax.get_legend() is None)
#
# @unittest.skipIf(is_github_ci(), "Skipping test in GitHub CI environment")
# @unittest.skipIf(not is_internet_available(), "Skipping test due to no internet connection")
# def test_plot_esri(self):
# basemap = "ESRI_terrain"
#
# ax = plot_basemap(
# basemap,
# self.chiloe_extent,
# coastline=True,
# borders=True,
# tile_depth=4,
# show=show_plots,
# )
# self.assertIsInstance(ax, plt.Axes)
# self.assertTrue(ax.get_legend() is None)

@unittest.skipIf(is_github_ci(), "Skipping test in GitHub CI environment")
@unittest.skipIf(not is_internet_available(), "Skipping test due to no internet connection")
def test_plot_google_satellite(self):
basemap = "google-satellite"
ax = plot_basemap(
basemap=basemap,
extent=self.chiloe_extent,
coastline=True,
tile_depth=4,
show=show_plots,
)
self.assertIsInstance(ax, plt.Axes)
self.assertTrue(ax.get_legend() is None)

@unittest.skipIf(is_github_ci(), "Skipping test in GitHub CI environment")
@unittest.skipIf(not is_internet_available(), "Skipping test due to no internet connection")
def test_plot_esri(self):
basemap = "ESRI_terrain"

ax = plot_basemap(
basemap,
self.chiloe_extent,
coastline=True,
borders=True,
tile_depth=4,
show=show_plots,
)
self.assertIsInstance(ax, plt.Axes)
self.assertTrue(ax.get_legend() is None)

@patch("csep.utils.plots._get_basemap")
def test_plot_basemap_set_global(self, mock_get_basemap):
Expand All @@ -770,6 +770,7 @@ def test_plot_basemap_set_global(self, mock_get_basemap):
mock_get_basemap.assert_not_called()
self.assertTrue(ax.get_extent() == (-180, 180, -90, 90))

@unittest.skipIf(is_github_ci(), "Skipping test in GitHub CI environment")
def test_plot_basemap_tif_file(self):
basemap = csep.datasets.basemap_california
projection = ccrs.PlateCarree()
Expand Down

0 comments on commit c75f3bd

Please sign in to comment.