ObsTests#
- class lsst.obs.base.tests.ObsTests#
Bases:
ButlerGetTests,CameraTestsAggregator class for all of the obs_* test classes.
Inherit from this class, then lsst.utils.tests.TestCase, in that order.
Example subclass:
class TestObs( lsst.obs.base.tests.ObsTests, lsst.utils.tests.TestCase ): def setUp(self): self.setUp_tests(...) self.setUp_butler_get(...) self.setUp_camera(...)
Notes#
The intention is for each obs package to have a single test class that inherits from this collector class, thus “automatically” getting all new tests. If those tests require setup that isn’t defined in a given obs package, that obs package will be broken until updated. This is intentional, as a way to prevent obs packages from falling behind out of neglect.
Methods Summary
setUp_tests(butler, dataIds)Set up the necessary shared variables used by multiple tests.
tearDown()Methods Documentation
- setUp_tests(butler, dataIds)#
Set up the necessary shared variables used by multiple tests.
Parameters#
- butler:
lsst.daf.butler.Butler A butler object, instantiated on the testdata repository for the obs package being tested.
- dataIds:
dict dictionary of (exposure name): (dataId of that exposure in the testdata repository), with unittest.SkipTest as the value for any exposures you do not have/do not want to test. It must contain a valid ‘raw’ dataId, in addition to ‘bias’,’flat’,’dark’, which may be set to SkipTest. For example:
self.dataIds = { "raw": {"visit": 1, "filter": "g"}, "bias": {"visit": 1}, "flat": {"visit": 1}, "dark": unittest.SkipTest, }
- butler:
- tearDown()#