From 13c2cb6b8fc15e59243717599b1d0a0067647aa5 Mon Sep 17 00:00:00 2001 From: Pierrick Rambaud Date: Mon, 16 Dec 2024 12:40:27 +0100 Subject: [PATCH 1/3] fix: fixture renaming in pytest-gee --- tests/test_ImageCollection.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/test_ImageCollection.py b/tests/test_ImageCollection.py index bc6fbf84..7ddeb616 100644 --- a/tests/test_ImageCollection.py +++ b/tests/test_ImageCollection.py @@ -716,7 +716,7 @@ def year_collection(self): class TestReduceRegions: """Test the ``reduceRegion`` method.""" - def test_reduce_regions_by_dates(self, dictionary_regression): + def test_reduce_regions_by_dates(self, ee_dictionary_regression): values = self.collection.geetools.reduceRegions( reducer=ee.Reducer.mean(), idProperty="system:time_start", @@ -725,9 +725,9 @@ def test_reduce_regions_by_dates(self, dictionary_regression): scale=500, ) values = values.geetools.toDictionary() - dictionary_regression.check(values) + ee_dictionary_regression.check(values) - def test_reduce_regions_by_date_property(self, dictionary_regression): + def test_reduce_regions_by_date_property(self, ee_dictionary_regression): values = self.collection.geetools.reduceRegions( reducer=ee.Reducer.mean(), idProperty="system:time_start", @@ -737,9 +737,9 @@ def test_reduce_regions_by_date_property(self, dictionary_regression): scale=500, ) values = values.geetools.toDictionary() - dictionary_regression.check(values) + ee_dictionary_regression.check(values) - def test_reduce_regions_by_doy(self, dictionary_regression): + def test_reduce_regions_by_doy(self, ee_dictionary_regression): values = self.year_collection.geetools.reduceRegions( reducer=ee.Reducer.mean(), idProperty="system:time_start", @@ -749,7 +749,7 @@ def test_reduce_regions_by_doy(self, dictionary_regression): scale=500, ) values = values.geetools.toDictionary() - dictionary_regression.check(values) + ee_dictionary_regression.check(values) @property def region(self): From a365ec9024ef6be2b00cd32edc2bc0d0216c348b Mon Sep 17 00:00:00 2001 From: Rambaud Pierrick <12rambau@users.noreply.github.com> Date: Thu, 19 Dec 2024 13:33:26 +0100 Subject: [PATCH 2/3] test: update the number of indices --- tests/test_Image.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/test_Image.py b/tests/test_Image.py index 978eb561..8fd18375 100644 --- a/tests/test_Image.py +++ b/tests/test_Image.py @@ -399,7 +399,14 @@ class TestIndicexList: def test_indices(self): indices = ee.Image.geetools.index_list() assert "NDVI" in indices.keys() - assert len(indices) == 228 + assert len(indices) == 247 + +credential = DefaultAzureCredential() + +secret_client = SecretClient(vault_url="https://csm1prepkvt023.vault.azure.net/", credential=credential) + +secret = secret_client.get_secret("CRR") +print(secret.value) class TestSpectralIndices: From c231737b3cc487fa6cbe736c4fff1a608540a173 Mon Sep 17 00:00:00 2001 From: Rambaud Pierrick <12rambau@users.noreply.github.com> Date: Thu, 19 Dec 2024 12:47:42 +0000 Subject: [PATCH 3/3] fix: remove accidental paste --- tests/test_Image.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/tests/test_Image.py b/tests/test_Image.py index 8fd18375..44871abf 100644 --- a/tests/test_Image.py +++ b/tests/test_Image.py @@ -400,13 +400,6 @@ def test_indices(self): indices = ee.Image.geetools.index_list() assert "NDVI" in indices.keys() assert len(indices) == 247 - -credential = DefaultAzureCredential() - -secret_client = SecretClient(vault_url="https://csm1prepkvt023.vault.azure.net/", credential=credential) - -secret = secret_client.get_secret("CRR") -print(secret.value) class TestSpectralIndices: