Skip to content

Commit

Permalink
Update true color reproduction tests to check for missing / bad platf…
Browse files Browse the repository at this point in the history
…orms.
  • Loading branch information
simonrp84 committed May 10, 2023
1 parent a5b5158 commit 3ef1f6d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion satpy/tests/enhancement_tests/test_enhancements.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,5 +673,14 @@ def test_jma_true_color_reproduction(self):
img = XRImage(self.rgb)
jma_true_color_reproduction(img)

print(img.data.compute())
np.testing.assert_almost_equal(img.data.compute(), expected)

self.rgb.attrs['platform_name'] = None
img = XRImage(self.rgb)
with pytest.raises(ValueError, match="Missing platform name."):
jma_true_color_reproduction(img)

self.rgb.attrs['platform_name'] = 'Fakesat'
img = XRImage(self.rgb)
with pytest.raises(KeyError, match="No conversion matrix found for platform Fakesat"):
jma_true_color_reproduction(img)

0 comments on commit 3ef1f6d

Please sign in to comment.