From c75f3bdfc122c11b6c112c3f17f3a4a668b7dd80 Mon Sep 17 00:00:00 2001 From: pciturri Date: Fri, 23 Aug 2024 15:43:04 +0200 Subject: [PATCH] refactor: Added type hints and docstrings to helper functions. Removed unused helper functions --- tests/test_plots.py | 61 +++++++++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 30 deletions(-) diff --git a/tests/test_plots.py b/tests/test_plots.py index 2507177a..b4f8802a 100644 --- a/tests/test_plots.py +++ b/tests/test_plots.py @@ -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): @@ -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()