Coverage for tests/test_wcsCards.py : 46%

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
1#
2# LSST Data Management System
3# Copyright 2016 AURA/LSST.
4#
5# This product includes software developed by the
6# LSST Project (http://www.lsst.org/).
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU General Public License as published by
10# the Free Software Foundation, either version 3 of the License, or
11# (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the LSST License Statement and
19# the GNU General Public License along with this program. If not,
20# see <https://www.lsstcorp.org/LegalNotices/>.
21#
23import os
24import unittest
25import warnings
27from lsst.utils import getPackageDir
28import lsst.utils.tests
30import lsst.daf.persistence as dafPersist
31import lsst.pex.exceptions as pexExcept
34class WcsCardsTestCase(lsst.utils.tests.TestCase):
35 """Test wcs keywords in the metadata"""
37 def setUp(self):
38 try:
39 datadir = getPackageDir("testdata_decam")
40 except pexExcept.NotFoundError:
41 message = "testdata_decam not setup. Skipping."
42 warnings.warn(message)
43 raise unittest.SkipTest(message)
44 self.butler = dafPersist.Butler(root=os.path.join(datadir, "rawData"))
45 self.dataId = {'visit': 229388, 'ccdnum': 1}
47 def tearDown(self):
48 del self.butler
50 def testRawWcs(self):
51 """Test wcs keywords are removed from the metadata of the raw Exposure"""
52 exp = self.butler.get("raw", self.dataId, immediate=True)
53 self.assertFalse(exp.getMetadata().exists('CTYPE1'))
54 self.assertFalse(exp.getMetadata().exists('CD1_2'))
55 self.assertFalse(exp.getMetadata().exists('CRPIX2'))
56 self.assertFalse(exp.getMetadata().exists('PV1_4'))
57 self.assertFalse(exp.getMetadata().exists('PV2_10'))
60class MemoryTester(lsst.utils.tests.MemoryTestCase):
61 pass
64def setup_module(module):
65 lsst.utils.tests.init()
68if __name__ == "__main__": 68 ↛ 69line 68 didn't jump to line 69, because the condition on line 68 was never true
69 lsst.utils.tests.init()
70 unittest.main()