Hide keyboard shortcuts

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 

2 

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# 

24 

25""" 

26Comprehensive tests reading and retrieving data of all types 

27""" 

28 

29import unittest 

30import lsst.utils.tests 

31 

32from lsst.pex.policy import Policy, PolicyString 

33 

34 

35class PolicyStringTestCase(unittest.TestCase): 

36 

37 def setUp(self): 

38 self.data = """#<?cfg paf policy ?> 

39int: 7 

40dbl: -1.0 

41""" 

42 

43 def tearDown(self): 

44 pass 

45 

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) 

51 

52 

53class TestMemory(lsst.utils.tests.MemoryTestCase): 

54 pass 

55 

56 

57__all__ = "PolicyStringTestCase".split() 

58 

59 

60def setup_module(module): 

61 lsst.utils.tests.init() 

62 

63 

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()