Skip to content

Commit

Permalink
Add save footprint & geojson tests
Browse files Browse the repository at this point in the history
  • Loading branch information
HamedElgizery committed Aug 11, 2024
1 parent 5b4486a commit 978736f
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/imagery/i.eodag/testsuite/data/search_s2.geojson

Large diffs are not rendered by default.

34 changes: 34 additions & 0 deletions src/imagery/i.eodag/testsuite/test_eodag.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class TestEodag(TestCase):
@classmethod
def setUpClass(cls):
"""Use temporary region settings"""
print("EHRERKJELJZD")
cls.use_temp_region()
cls.runModule(
"v.extract",
Expand Down Expand Up @@ -272,6 +273,39 @@ def test_area_relation(self):
)
self.assertEqual(i_eodag.outputs["stdout"].value.strip(), output)

def test_save_result_geojson(self):
"""Test"""
# i.eodag -l map=durham provider=peps producttype=S2_MSI_L1C start=2022-05-01 end=2022-06-01 save=search_s2.geojson
i_eodag = Module(
"i.eodag",
flags="l",
provider="peps",
producttype="S2_MSI_L1C",
start="2022-05-01",
end="2022-06-01",
map="durham",
save="results/search_s2.geojson",
quiet=True,
overwrite=True,
)
self.assertFileExists("results/search_s2.geojson")
self.assertFilesEqualMd5("results/search_s2.geojson", "data/search_s2.geojson")

def test_save_footprint(self):
# i.eodag -l provider=peps producttype=S2_MSI_L1C start=2022-05-01 end=2022-06-01 footprints=s2_footprints
# This is not working...?
# v.import seems to complain
self.assertModule(
"i.eodag",
flags="l",
provider="peps",
producttype="S2_MSI_L1C",
start="2022-05-01",
end="2022-06-01",
map="durham",
footprints="s2_footprints",
)


if __name__ == "__main__":
from grass.gunittest.main import test
Expand Down

0 comments on commit 978736f

Please sign in to comment.