Coverage for tests/test_dagIdInfo.py: 46%
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
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
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 os
24import sys
25import unittest
26from subprocess import Popen, PIPE
27import lsst.utils.tests
30def setup_module(module):
31 lsst.utils.tests.init()
34class TestDagIdInfo(lsst.utils.tests.TestCase):
36 def executeCommand(self, cmd):
37 p = Popen(cmd.split(), stdout=PIPE, stderr=PIPE)
38 stdout, stderr = p.communicate()
39 stdout = stdout.decode()
40 return stdout
42 def test1(self):
43 exe = sys.executable
44 execPath = os.path.join("bin.src", "dagIdInfo.py")
45 filename = os.path.join("tests", "testfiles", "test.diamond.dag")
47 stdout = self.executeCommand("%s %s A1 %s" % (exe, execPath, filename))
48 self.assertEqual(stdout, 'run=1033 filter=r camcol=2 field=229\n')
50 stdout = self.executeCommand("%s %s A3 %s" % (exe, execPath, filename))
51 self.assertEqual(stdout, 'run=1033 filter=i camcol=2 field=47\n')
53 stdout = self.executeCommand("%s %s A17 %s" % (exe, execPath, filename))
54 val = 'run=1033 filter=r camcol=2 field=229 run=1033 filter=i camcol=2 field=47\n'
55 self.assertEqual(stdout, val)
57 stdout = self.executeCommand("%s %s B1 %s" % (exe, execPath, filename))
58 self.assertEqual(stdout, '')
61class TestDagInfoMemoryTest(lsst.utils.tests.MemoryTestCase):
62 pass
65if __name__ == "__main__": 65 ↛ 66line 65 didn't jump to line 66, because the condition on line 65 was never true
66 lsst.utils.tests.init()
67 unittest.main()