Coverage for tests/test_helpers.py : 44%

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
1import unittest
2import os
4from lsst.ts.observatory.model import read_conf_file
5import lsst.utils.tests
7class HelpersTest(unittest.TestCase):
9 def test_read_conf_file(self):
10 file_path = os.path.join(os.path.dirname(__file__), "dummy.conf")
11 conf_dict = read_conf_file(file_path)
12 self.assertEqual(len(conf_dict), 3)
13 self.assertEqual(conf_dict["section1"]["par1"], 15.0)
14 self.assertEqual(conf_dict["section1"]["par2"], "test")
15 self.assertListEqual(conf_dict["section1"]["par3"],
16 ["good", "to", "go"])
17 self.assertListEqual(conf_dict["section2"]["par4"],
18 [7.0, 8.0, 9.0])
19 self.assertFalse(conf_dict["section2"]["par5"])
20 self.assertEqual(conf_dict["section3"]["par6"], 0.5)
21 self.assertListEqual(conf_dict["section3"]["par7"],
22 [("test1", 1.0, 30.0), ("test2", 4.0, 50.0)])
24class MemoryTestClass(lsst.utils.tests.MemoryTestCase):
25 pass
27def setup_module(module):
28 lsst.utils.tests.init()
30if __name__ == "__main__": 30 ↛ 31line 30 didn't jump to line 31, because the condition on line 30 was never true
31 lsst.utils.tests.init()
32 unittest.main()