From 9e9c6f48dc69a9b9be73f4d8a193832365e89336 Mon Sep 17 00:00:00 2001 From: Pierrick Rambaud Date: Sun, 28 Jan 2024 18:06:10 +0100 Subject: [PATCH 1/2] fix: test deprecation of fillNull --- geetools/tools/_deprecated_element.py | 2 +- tests/test_deprecated.py | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/geetools/tools/_deprecated_element.py b/geetools/tools/_deprecated_element.py index 0d2c58e0..1deca43a 100644 --- a/geetools/tools/_deprecated_element.py +++ b/geetools/tools/_deprecated_element.py @@ -5,4 +5,4 @@ @deprecated(version="1.0.0", reason="Don't use this method it's considered bad practice.") def fillNull(Element, proxy=-999): """Fill null values of an Element's properties with a proxy value.""" - raise Exception("This method is deprecated. Use ee.FeatureCollection.fill() instead") + raise NotImplementedError("This method is deprecated. Use ee.FeatureCollection.fill() instead") diff --git a/tests/test_deprecated.py b/tests/test_deprecated.py index df3c38ac..7040e8d9 100644 --- a/tests/test_deprecated.py +++ b/tests/test_deprecated.py @@ -15,3 +15,11 @@ def test_stretch_std(self): def test_stretch_percentile(self): with pytest.raises(NotImplementedError): geetools.visualization.stretch_percentile(None, None) + + +class TestElement: + """Test the methods from the deprecated_element module.""" + + def test_fillNull(self): + with pytest.raises(NotImplementedError): + geetools.tools.fillNull(None, None) From 4614a1d7a8854ee084d8b4270eb60333cabb9b16 Mon Sep 17 00:00:00 2001 From: Pierrick Rambaud Date: Sun, 28 Jan 2024 18:14:28 +0100 Subject: [PATCH 2/2] fix: typo --- tests/test_deprecated.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_deprecated.py b/tests/test_deprecated.py index 7040e8d9..7ddb3913 100644 --- a/tests/test_deprecated.py +++ b/tests/test_deprecated.py @@ -22,4 +22,4 @@ class TestElement: def test_fillNull(self): with pytest.raises(NotImplementedError): - geetools.tools.fillNull(None, None) + geetools.element.fillNull(None, None)