Coverage for tests/test_wcsCards.py: 50%
32 statements
« prev ^ index » next coverage.py v6.4.1, created at 2022-06-11 03:44 -0700
« prev ^ index » next coverage.py v6.4.1, created at 2022-06-11 03:44 -0700
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
33class WcsCardsTestCase(lsst.utils.tests.TestCase):
34 """Test wcs keywords in the metadata"""
36 def setUp(self):
37 try:
38 datadir = getPackageDir("testdata_decam")
39 except LookupError:
40 message = "testdata_decam not setup. Skipping."
41 warnings.warn(message)
42 raise unittest.SkipTest(message)
43 self.butler = dafPersist.Butler(root=os.path.join(datadir, "rawData"))
44 self.dataId = {'visit': 229388, 'ccdnum': 1}
46 def tearDown(self):
47 del self.butler
49 def testRawWcs(self):
50 """Test wcs keywords are removed from the metadata of the raw Exposure"""
51 exp = self.butler.get("raw", self.dataId, immediate=True)
52 self.assertFalse(exp.getMetadata().exists('CTYPE1'))
53 self.assertFalse(exp.getMetadata().exists('CD1_2'))
54 self.assertFalse(exp.getMetadata().exists('CRPIX2'))
55 self.assertFalse(exp.getMetadata().exists('PV1_4'))
56 self.assertFalse(exp.getMetadata().exists('PV2_10'))
59class MemoryTester(lsst.utils.tests.MemoryTestCase):
60 pass
63def setup_module(module):
64 lsst.utils.tests.init()
67if __name__ == "__main__": 67 ↛ 68line 67 didn't jump to line 68, because the condition on line 67 was never true
68 lsst.utils.tests.init()
69 unittest.main()