Coverage for tests/test_testUtils.py : 96%

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
# # Developed for the LSST Data Management System. # This product includes software developed by the LSST Project # (https://www.lsst.org). # See the COPYRIGHT file at the top-level directory of this distribution # for details of code ownership. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. #
# importing lsst.geom adds assert methods to lsst.utils.tests.TestCase, # and these are most or all of what this module tests
"""Test test methods added to lsst.utils.tests.TestCase """ """Test assertAnglesAlmostEqual""" ang0, ang0 + 0.01*lsst.geom.arcseconds, maxDiff=0.010001*lsst.geom.arcseconds, ) ang0, ang0 + 0.01*lsst.geom.arcseconds, maxDiff=0.009999*lsst.geom.arcseconds, )
ang0, ang0 - 0.01*lsst.geom.arcseconds, maxDiff=0.010001*lsst.geom.arcseconds, ) ang0, ang0 - 0.01*lsst.geom.arcseconds, maxDiff=0.009999*lsst.geom.arcseconds, )
ang0 - 720*lsst.geom.degrees, ang0 + 0.01*lsst.geom.arcseconds, maxDiff=0.010001*lsst.geom.arcseconds, ) ang0 - 720*lsst.geom.degrees, ang0 + 0.01*lsst.geom.arcseconds, ignoreWrap=False, maxDiff=0.010001*lsst.geom.arcseconds, ) ang0 - 720*lsst.geom.degrees, ang0 + 0.01*lsst.geom.arcseconds, maxDiff=0.009999*lsst.geom.arcseconds, )
ang0, ang0 + 360*lsst.geom.degrees + 0.01*lsst.geom.arcseconds, maxDiff=0.010001*lsst.geom.arcseconds, ) ang0, ang0 + 360*lsst.geom.degrees + 0.01*lsst.geom.arcseconds, ignoreWrap=False, maxDiff=0.010001*lsst.geom.arcseconds, ) ang0, ang0 + 360*lsst.geom.degrees + 0.01*lsst.geom.arcseconds, maxDiff=0.009999*lsst.geom.arcseconds, )
"""Test assertBoxesAlmostEqual""" box0.getMin() + deltaExtent, box0.getMax()) box0, box1, maxDiff=radDiff*1.00001) box0, box1, maxDiff=radDiff*0.99999)
box0.getMin() - deltaExtent, box0.getMax()) box0, box2, maxDiff=radDiff*1.00001) box0, box2, maxDiff=radDiff*0.999999)
box0.getMin(), box0.getMax() + deltaExtent) box0, box3, maxDiff=radDiff*1.00001) box0, box3, maxDiff=radDiff*0.999999)
"""Test assertSpherePointsAlmostEqual""" sp0, sp0, maxSep=1e-7*lsst.geom.arcseconds) # make sure specifying msg is acceptable sp0, sp0, maxSep=1e-7*lsst.geom.arcseconds, msg="any")
sp0, sp1, maxSep=offDist*1.00001) sp0, sp1, maxSep=offDist*0.99999)
# make sure msg is appended sp0, sp1, maxSep=offDist*0.99999, msg="boo") self.fail("Sphere point lists should be unequal")
# test wraparound in RA raDecDeg[0] + 360*lsst.geom.degrees, raDecDeg[1]) sp0, sp2, maxSep=1e-7*lsst.geom.arcseconds)
"""Test assertSpherePointListsAlmostEqual """ for val in ((45, 45), (-70, 89), (130, -89.5))]
for sp0, bearDeg in zip(splist0, (-10, 78, 123))] splist0, splist1, maxSep=offDist*1.00001) splist0, splist1, maxSep=offDist*0.99999)
# make sure msg is appended splist0, splist1, maxSep=offDist*0.99999, msg="boo") self.fail("Sphere point lists should be unequal")
"""Test assertPairsAlmostEqual""" lsst.geom.Extent2D(*pair0), maxDiff=1e-7) pair0, pair1, maxDiff=radialDiff+1e-7) pair0, pair1, maxDiff=radialDiff-1e-7)
lsst.utils.tests.init() unittest.main() |