Coverage for tests / test_allocatorParser.py: 41%

25 statements  

« prev     ^ index     » next       coverage.py v7.12.0, created at 2025-12-17 16:44 -0800

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 

25 

26import lsst.utils.tests 

27from lsst.ctrl.execute.allocatorParser import AllocatorParser 

28 

29 

30def setup_module(module): 

31 lsst.utils.tests.init() 

32 

33 

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

35 def test1(self): 

36 sys.argv = [ 

37 "test1", 

38 "test_platform", 

39 "-n", 

40 "64", 

41 "-c", 

42 "12", 

43 "-m", 

44 "00:30:00", 

45 "--exclude", 

46 "sdfmilan003", 

47 "--nodelist", 

48 "sdfmilan004", 

49 "-q", 

50 "normal", 

51 "-O", 

52 "outlog", 

53 "-E", 

54 "errlog", 

55 "-v", 

56 ] 

57 

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

59 args = al.getArgs() 

60 

61 self.assertEqual(args.nodeCount, 64) 

62 self.assertEqual(args.cpus, 12) 

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

64 self.assertEqual(args.exclude, "sdfmilan003") 

65 self.assertEqual(args.nodelist, "sdfmilan004") 

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

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

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

69 self.assertTrue(args.verbose) 

70 

71 

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

73 pass 

74 

75 

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