Coverage for tests / test_allocatorParser.py: 38%
27 statements
« prev ^ index » next coverage.py v7.13.5, created at 2026-05-06 08:41 +0000
« prev ^ index » next coverage.py v7.13.5, created at 2026-05-06 08:41 +0000
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#
23import sys
24import unittest
26import lsst.utils.tests
27from lsst.ctrl.execute.allocatorParser import AllocatorParser
30def setup_module(module):
31 lsst.utils.tests.init()
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 "--mempercore",
50 "6144",
51 "--collector",
52 "sdfiana039",
53 "-q",
54 "normal",
55 "-O",
56 "outlog",
57 "-E",
58 "errlog",
59 "-v",
60 ]
62 al = AllocatorParser(sys.argv[0])
63 args = al.getArgs()
65 self.assertEqual(args.nodeCount, 64)
66 self.assertEqual(args.cpus, 12)
67 self.assertEqual(args.maximumWallClock, "00:30:00")
68 self.assertEqual(args.exclude, "sdfmilan003")
69 self.assertEqual(args.nodelist, "sdfmilan004")
70 self.assertEqual(args.mempercore, 6144)
71 self.assertEqual(args.collector, "sdfiana039")
72 self.assertEqual(args.queue, "normal")
73 self.assertEqual(args.outputLog, "outlog")
74 self.assertEqual(args.errorLog, "errlog")
75 self.assertTrue(args.verbose)
78class AllocatorParserMemoryTester(lsst.utils.tests.MemoryTestCase):
79 pass
82if __name__ == "__main__": 82 ↛ 83line 82 didn't jump to line 83 because the condition on line 82 was never true
83 lsst.utils.tests.init()
84 unittest.main()