Coverage for tests/test_PolicyString.py : 58%

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#!/usr/bin/env python
3#
4# LSST Data Management System
5# Copyright 2008, 2009, 2010 LSST Corporation.
6#
7# This product includes software developed by the
8# LSST Project (http://www.lsst.org/).
9#
10# This program is free software: you can redistribute it and/or modify
11# it under the terms of the GNU General Public License as published by
12# the Free Software Foundation, either version 3 of the License, or
13# (at your option) any later version.
14#
15# This program is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18# GNU General Public License for more details.
19#
20# You should have received a copy of the LSST License Statement and
21# the GNU General Public License along with this program. If not,
22# see <http://www.lsstcorp.org/LegalNotices/>.
23#
25"""
26Comprehensive tests reading and retrieving data of all types
27"""
29import unittest
30import lsst.utils.tests
32from lsst.pex.policy import Policy, PolicyString
35class PolicyStringTestCase(unittest.TestCase):
37 def setUp(self):
38 self.data = """#<?cfg paf policy ?>
39int: 7
40dbl: -1.0
41"""
43 def tearDown(self):
44 pass
46 def testRead(self):
47 ps = PolicyString(self.data)
48 p = Policy.createPolicy(ps)
49 self.assertEqual(p.get("int"), 7)
50 self.assertEqual(p.get("dbl"), -1.0)
53class TestMemory(lsst.utils.tests.MemoryTestCase):
54 pass
57__all__ = "PolicyStringTestCase".split()
60def setup_module(module):
61 lsst.utils.tests.init()
64if __name__ == "__main__": 64 ↛ 65line 64 didn't jump to line 65, because the condition on line 64 was never true
65 lsst.utils.tests.init()
66 unittest.main()