Coverage for tests/testStellarMags.py : 31%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
lsst.utils.tests.init()
""" Test the example stellar colors code """
keys = ['O', 'B', 'A', 'F', 'G', 'K', 'M', 'HeWD_25200_80', 'WD_11000_85', 'WD_3000_85'] filterNames = ['u', 'g', 'r', 'i', 'z', 'y']
# Check each type returns the correct format for key in keys: result = utils.stellarMags(key) for fn in filterNames: self.assertIn(fn, result) self.assertTrue((isinstance(result[fn], float)) | (isinstance(result[fn], np.float64)), msg='result is neither a float nor a numpy float64')
# Check the exception gets raised self.assertRaises(ValueError, utils.stellarMags, 'ack')
# Check the mags get fainter for st in keys: mags = utils.stellarMags(st) mags2 = utils.stellarMags(st, rmag=20.) for key in mags: self.assertLess(mags[key], mags2[key])
lsst.utils.tests.init() unittest.main() |