Skip to content

Commit

Permalink
Make testGetWcs behavior and docstring consistent.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrawls committed Jun 4, 2020
1 parent 6c8df71 commit fa3fed9
Showing 1 changed file with 10 additions and 20 deletions.
30 changes: 10 additions & 20 deletions tests/test_exposure.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,27 +182,17 @@ def testProperties(self):
self.assertImagesEqual(self.exposureMiOnly.variance, var3)

def testGetWcs(self):
"""Test that a WCS can be obtained from each Exposure created with
a WCS, and that an Exposure lacking a WCS returns None.
"""
Test if a WCS can be obtained from each Exposure created with
a WCS.
Test that appropriate exceptions are thrown if a WCS is
requested from an Exposure that was not created with a WCS.
Python turns the pex::exceptions in the Exposure and
MaskedImage classes into IndexErrors.
The exposureBlank, exposureMiOnly, and exposureCrOnly
Exposures should throw a lsst::pex::exceptions::NotFound.
"""

self.assertFalse(self.exposureBlank.getWcs())
self.assertFalse(self.exposureMiOnly.getWcs())

# These two should pass
self.exposureMiWcs.getWcs()
self.exposureCrWcs.getWcs()

self.assertFalse(self.exposureCrOnly.getWcs())
# These exposures don't contain a WCS
self.assertIsNone(self.exposureBlank.getWcs())
self.assertIsNone(self.exposureMiOnly.getWcs())
self.assertIsNone(self.exposureCrOnly.getWcs())

# These exposures should contain a WCS
self.assertEqual(self.wcs, self.exposureMiWcs.getWcs())
self.assertEqual(self.wcs, self.exposureCrWcs.getWcs())

def testExposureInfoConstructor(self):
"""Test the Exposure(maskedImage, exposureInfo) constructor"""
Expand Down

0 comments on commit fa3fed9

Please sign in to comment.