3 # Copyright (C) 2010-2012 CEA/DEN
5 # This library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2.1 of the License.
10 # This library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with this library; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 testdir = os.path.dirname(os.path.realpath(__file__))
25 sys.path.append(os.path.join(testdir, '..', '..'))
26 sys.path.append(os.path.join(testdir, '..', '_testTools'))
27 sys.path.append(os.path.join(testdir, '..', '..','commands'))
29 from salomeTools import Sat
32 class TestTest(unittest.TestCase):
33 '''Test of the test command
37 '''Test the test command
40 tmp_file = "/tmp/test.txt"
41 application = "SALOME-7.8.0"
43 sat = Sat("-l " + tmp_file)
45 # Execute the job command
46 sat.test(application + " --grid GEOM --session light" )
48 ff = open(tmp_file, "r")
49 log_files = ff.readlines()
52 log_testboard = [line.replace("\n", "") for line in log_files if 'testboard.xml' in line]
54 text = open(log_testboard[0], "r").read()
56 if '<session name="light">' in text:
58 # pyunit method to compare 2 str
59 self.assertEqual(OK, 'OK')
61 def test_PY_test(self):
62 '''Test the test command with PY type
65 tmp_file = "/tmp/test.txt"
66 application = "SALOME-7.8.0"
68 sat = Sat("-l " + tmp_file)
70 # Execute the job command
71 sat.test(application + " --grid MED --session PY_test_withKernel" )
73 ff = open(tmp_file, "r")
74 log_files = ff.readlines()
77 log_testboard = [line.replace("\n", "") for line in log_files if 'testboard.xml' in line]
79 text = open(log_testboard[0], "r").read()
81 if '<session name="PY_test_withKernel">' in text:
83 # pyunit method to compare 2 str
84 self.assertEqual(OK, 'OK')
86 def test_description(self):
87 '''Test the sat -h test
94 if "The test command runs a test base on a SALOME installation" in test.description():
97 # pyunit method to compare 2 str
98 self.assertEqual(OK, "OK")
101 if __name__ == '__main__':
102 HTMLTestRunner.main()