Coverage for tests/test_BigBool.py : 41%

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
31import lsst.utils
32import lsst.utils.tests
33from lsst.pex.policy import Policy
35proddir = lsst.utils.getPackageDir('pex_policy')
38class BigBoolTestCase(unittest.TestCase):
40 def setUp(self):
41 self.policy = Policy()
43 def tearDown(self):
44 del self.policy
46 def testBigBoolArray(self):
47 biglen = 1000
48 self.policy.isBool("true")
49 for i in range(biglen):
50 self.policy.add("true", True)
52 v = self.policy.getArray("true")
53 self.assertEqual(len(v), biglen, "wrong big number of values in array")
54 for i in range(biglen):
55 self.assertTrue(v[i], "big array with bad value")
57 del v
58 self.assertTrue(True, "Blew up True")
60 fd = open("/dev/null", "w")
61 print("look: %s" % True, file=fd)
62 fd.close()
65class TestMemory(lsst.utils.tests.MemoryTestCase):
66 pass
69__all__ = "BigBoolTestCase".split()
72def setup_module(module):
73 lsst.utils.tests.init()
76if __name__ == "__main__": 76 ↛ 77line 76 didn't jump to line 77, because the condition on line 76 was never true
77 lsst.utils.tests.init()
78 unittest.main()