Skip to content

Commit

Permalink
Tests updated and OK
Browse files Browse the repository at this point in the history
  • Loading branch information
davemlz committed Jan 5, 2021
1 parent 5f44099 commit 12b38df
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 20 deletions.
12 changes: 7 additions & 5 deletions tests/.ipynb_checkpoints/test_image-checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,34 @@
L5 = ee.ImageCollection('LANDSAT/LT05/C01/T1_SR').first()
L4 = ee.ImageCollection('LANDSAT/LT04/C01/T1_SR').first()

indices = ['NDVI','BAIS2']

class Test(unittest.TestCase):
"""Tests for `eemont` package."""

def test_S2(self):
"""Test the image module for Sentinel-2"""
S2_tested = S2.maskClouds().scale().index()
S2_tested = S2.maskClouds().scale().index(indices)
self.assertIsInstance(S2_tested, ee.image.Image)

def test_L8(self):
"""Test the image module for Landsat 8"""
L8_tested = L8.maskClouds().scale().index()
L8_tested = L8.maskClouds().scale().index(indices)
self.assertIsInstance(L8_tested, ee.image.Image)

def test_L7(self):
"""Test the image module for Landsat 7"""
L7_tested = L7.maskClouds().scale().index()
L7_tested = L7.maskClouds().scale().index(indices)
self.assertIsInstance(L7_tested, ee.image.Image)

def test_L5(self):
"""Test the image module for Landsat 5"""
L5_tested = L5.maskClouds().scale().index()
L5_tested = L5.maskClouds().scale().index(indices)
self.assertIsInstance(L5_tested, ee.image.Image)

def test_L4(self):
"""Test the image module for Landsat 4"""
L4_tested = L4.maskClouds().scale().index()
L4_tested = L4.maskClouds().scale().index(indices)
self.assertIsInstance(L4_tested, ee.image.Image)

if __name__ == '__main__':
Expand Down
12 changes: 7 additions & 5 deletions tests/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,34 @@
L5 = ee.ImageCollection('LANDSAT/LT05/C01/T1_SR').first()
L4 = ee.ImageCollection('LANDSAT/LT04/C01/T1_SR').first()

indices = ['NDVI','BAIS2']

class Test(unittest.TestCase):
"""Tests for `eemont` package."""

def test_S2(self):
"""Test the image module for Sentinel-2"""
S2_tested = S2.maskClouds().scale().index()
S2_tested = S2.maskClouds().scale().index(indices)
self.assertIsInstance(S2_tested, ee.image.Image)

def test_L8(self):
"""Test the image module for Landsat 8"""
L8_tested = L8.maskClouds().scale().index()
L8_tested = L8.maskClouds().scale().index(indices)
self.assertIsInstance(L8_tested, ee.image.Image)

def test_L7(self):
"""Test the image module for Landsat 7"""
L7_tested = L7.maskClouds().scale().index()
L7_tested = L7.maskClouds().scale().index(indices)
self.assertIsInstance(L7_tested, ee.image.Image)

def test_L5(self):
"""Test the image module for Landsat 5"""
L5_tested = L5.maskClouds().scale().index()
L5_tested = L5.maskClouds().scale().index(indices)
self.assertIsInstance(L5_tested, ee.image.Image)

def test_L4(self):
"""Test the image module for Landsat 4"""
L4_tested = L4.maskClouds().scale().index()
L4_tested = L4.maskClouds().scale().index(indices)
self.assertIsInstance(L4_tested, ee.image.Image)

if __name__ == '__main__':
Expand Down
22 changes: 12 additions & 10 deletions tests/test_imagecollection.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,34 @@
L5 = ee.ImageCollection('LANDSAT/LT05/C01/T1_SR').filterBounds(point)
L4 = ee.ImageCollection('LANDSAT/LT04/C01/T1_SR').filterBounds(point)

indices = ['NDVI','BAIS2']

class Test(unittest.TestCase):
"""Tests for `eemont` package."""

def test_S2(self):
"""Test the image module for Sentinel-2"""
S2_tested = S2.closest('2020-01-15').maskClouds().scale().index()
"""Test the image collection module for Sentinel-2"""
S2_tested = S2.closest('2020-01-15').maskClouds().scale().index(indices)
self.assertIsInstance(S2_tested, ee.imagecollection.ImageCollection)

def test_L8(self):
"""Test the image module for Landsat 8"""
L8_tested = L8.closest('2020-01-15').maskClouds().scale().index()
"""Test the image collection module for Landsat 8"""
L8_tested = L8.closest('2020-01-15').maskClouds().scale().index(indices)
self.assertIsInstance(L8_tested, ee.imagecollection.ImageCollection)

def test_L7(self):
"""Test the image module for Landsat 7"""
L7_tested = L7.closest('2010-01-15').maskClouds().scale().index()
"""Test the image collection module for Landsat 7"""
L7_tested = L7.closest('2010-01-15').maskClouds().scale().index(indices)
self.assertIsInstance(L7_tested, ee.imagecollection.ImageCollection)

def test_L5(self):
"""Test the image module for Landsat 5"""
L5_tested = L5.closest('2000-01-15').maskClouds().scale().index()
"""Test the image collection module for Landsat 5"""
L5_tested = L5.closest('2000-01-15').maskClouds().scale().index(indices)
self.assertIsInstance(L5_tested, ee.imagecollection.ImageCollection)

def test_L4(self):
"""Test the image module for Landsat 4"""
L4_tested = L4.closest('1990-01-15').maskClouds().scale().index()
"""Test the image collection module for Landsat 4"""
L4_tested = L4.closest('1990-01-15').maskClouds().scale().index(indices)
self.assertIsInstance(L4_tested, ee.imagecollection.ImageCollection)

if __name__ == '__main__':
Expand Down

0 comments on commit 12b38df

Please sign in to comment.