Coverage for tests/test_ticket2905.py: 59%
20 statements
« prev ^ index » next coverage.py v7.5.1, created at 2024-05-16 03:19 -0700
« prev ^ index » next coverage.py v7.5.1, created at 2024-05-16 03:19 -0700
1#
2# LSST Data Management System
3# Copyright 2008-2013 LSST Corporation.
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 <http://www.lsstcorp.org/LegalNotices/>.
21#
23import os
24import os.path
25import unittest
27from lsst.afw.fits import readMetadata
28import lsst.utils.tests
30testPath = os.path.abspath(os.path.dirname(__file__))
33class Ticket2905Test(unittest.TestCase):
34 """Test reading a FITS header that contains:
36 INR-STR = 2E-05
37 """
39 def test(self):
40 path = os.path.join(testPath, "data", "ticket2905.fits")
41 md = readMetadata(path)
42 value = md.getScalar("INR-STR")
43 self.assertEqual(type(value), float)
44 self.assertEqual(value, 2.0e-5)
47class MemoryTester(lsst.utils.tests.MemoryTestCase):
48 pass
51def setup_module(module):
52 lsst.utils.tests.init()
55if __name__ == "__main__": 55 ↛ 56line 55 didn't jump to line 56, because the condition on line 55 was never true
56 lsst.utils.tests.init()
57 unittest.main()