Coverage for tests/test_allocatorParser.py: 44%
23 statements
« prev ^ index » next coverage.py v7.4.4, created at 2024-03-20 12:22 +0000
« prev ^ index » next coverage.py v7.4.4, created at 2024-03-20 12:22 +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 "-q",
46 "normal",
47 "-O",
48 "outlog",
49 "-E",
50 "errlog",
51 "-v",
52 ]
54 al = AllocatorParser(sys.argv[0])
55 args = al.getArgs()
57 self.assertEqual(args.nodeCount, 64)
58 self.assertEqual(args.cpus, 12)
59 self.assertEqual(args.maximumWallClock, "00:30:00")
60 self.assertEqual(args.queue, "normal")
61 self.assertEqual(args.outputLog, "outlog")
62 self.assertEqual(args.errorLog, "errlog")
63 self.assertTrue(args.verbose)
66class AllocatorParserMemoryTester(lsst.utils.tests.MemoryTestCase):
67 pass
70if __name__ == "__main__": 70 ↛ 71line 70 didn't jump to line 71, because the condition on line 70 was never true
71 lsst.utils.tests.init()
72 unittest.main()