Skip to content

Commit

Permalink
Fix unittests
Browse files Browse the repository at this point in the history
  • Loading branch information
mraspaud committed Nov 8, 2018
1 parent 58d88bb commit f50d101
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions satpy/tests/test_writers.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def test_enhance_empty_config(self):
self.assertIsNotNone(e.enhancement_tree)
get_enhanced_image(ds, enhancer=e)
self.assertSetEqual(set(e.sensor_enhancement_configs),
{self.ENH_FN3})
{os.path.abspath(self.ENH_FN3)})

def test_enhance_with_sensor_no_entry(self):
"""Test enhancing an image that has no configuration sections."""
Expand All @@ -225,7 +225,8 @@ def test_enhance_with_sensor_no_entry(self):
self.assertIsNotNone(e.enhancement_tree)
get_enhanced_image(ds, enhancer=e)
self.assertSetEqual(set(e.sensor_enhancement_configs),
{self.ENH_FN2, self.ENH_ENH_FN2})
{os.path.abspath(self.ENH_FN2),
os.path.abspath(self.ENH_ENH_FN2)})

def test_enhance_with_sensor_entry(self):
"""Test enhancing an image with a configuration section."""
Expand All @@ -240,7 +241,8 @@ def test_enhance_with_sensor_entry(self):
img = get_enhanced_image(ds, enhancer=e)
self.assertSetEqual(
set(e.sensor_enhancement_configs),
{self.ENH_FN, self.ENH_ENH_FN})
{os.path.abspath(self.ENH_FN),
os.path.abspath(self.ENH_ENH_FN)})
np.testing.assert_almost_equal(img.data.isel(bands=0).max().values,
1.)

Expand All @@ -251,7 +253,8 @@ def test_enhance_with_sensor_entry(self):
self.assertIsNotNone(e.enhancement_tree)
img = get_enhanced_image(ds, enhancer=e)
self.assertSetEqual(set(e.sensor_enhancement_configs),
{self.ENH_FN, self.ENH_ENH_FN})
{os.path.abspath(self.ENH_FN),
os.path.abspath(self.ENH_ENH_FN)})
np.testing.assert_almost_equal(img.data.isel(bands=0).max().values, 1.)

def test_enhance_with_sensor_entry2(self):
Expand All @@ -266,7 +269,8 @@ def test_enhance_with_sensor_entry2(self):
self.assertIsNotNone(e.enhancement_tree)
img = get_enhanced_image(ds, enhancer=e)
self.assertSetEqual(set(e.sensor_enhancement_configs),
{self.ENH_FN, self.ENH_ENH_FN})
{os.path.abspath(self.ENH_FN),
os.path.abspath(self.ENH_ENH_FN)})
np.testing.assert_almost_equal(img.data.isel(bands=0).max().values, 0.5)


Expand Down

0 comments on commit f50d101

Please sign in to comment.