Coverage for tests/test_allocatorParser.py: 48%

Shortcuts 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

25 statements  

1# 

2# LSST Data Management System 

3# Copyright 2008-2012 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# 

22 

23import sys 

24import unittest 

25from lsst.ctrl.execute.allocatorParser import AllocatorParser 

26import lsst.utils.tests 

27 

28 

29def setup_module(module): 

30 lsst.utils.tests.init() 

31 

32 

33class TestAllocatorParser(lsst.utils.tests.TestCase): 

34 

35 def test1(self): 

36 sys.argv = ["test1", 

37 "test_platform", 

38 "-n", "64", 

39 "-c", "12", 

40 "-m", "00:30:00", 

41 "-N", "test_set", 

42 "-q", "normal", 

43 "-e", 

44 "-O", "outlog", 

45 "-E", "errlog", 

46 "-v", 

47 ] 

48 

49 al = AllocatorParser(sys.argv[0]) 

50 args = al.getArgs() 

51 

52 self.assertEqual(args.nodeCount, 64) 

53 self.assertEqual(args.cpus, 12) 

54 self.assertEqual(args.maximumWallClock, "00:30:00") 

55 self.assertEqual(args.nodeSet, "test_set") 

56 self.assertEqual(args.queue, "normal") 

57 self.assertTrue(args.email) 

58 self.assertEqual(args.outputLog, "outlog") 

59 self.assertEqual(args.errorLog, "errlog") 

60 self.assertTrue(args.verbose) 

61 

62 

63class AllocatorParserMemoryTester(lsst.utils.tests.MemoryTestCase): 

64 pass 

65 

66 

67if __name__ == "__main__": 67 ↛ 68line 67 didn't jump to line 68, because the condition on line 67 was never true

68 lsst.utils.tests.init() 

69 unittest.main()