4 # Copyright (C) 2010-2018 CEA/DEN
6 # This library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation; either
9 # version 2.1 of the License.
11 # This library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # Lesser General Public License for more details.
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with this library; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 from src.salomeTools import Sat
26 class TestTest(unittest.TestCase):
27 """Test of the test command"""
30 # Test the test command
32 tmp_file = "/tmp/test.txt"
33 application = "SALOME-7.8.0"
35 sat = Sat("-l " + tmp_file)
37 # Execute the job command
38 sat.test(application + " --grid GEOM --session light" )
40 ff = open(tmp_file, "r")
41 log_files = ff.readlines()
44 log_testboard = [line.replace("\n", "") for line in log_files if 'testboard.xml' in line]
46 text = open(log_testboard[0], "r").read()
48 if '<session name="light">' in text:
50 self.assertEqual(OK, 'OK')
53 # Test the test command with PY type
55 tmp_file = "/tmp/test.txt"
56 application = "SALOME-7.8.0"
58 sat = Sat("-l " + tmp_file)
60 # Execute the job command
61 sat.test(application + " --grid MED --session PY_test_withKernel" )
63 ff = open(tmp_file, "r")
64 log_files = ff.readlines()
67 log_testboard = [line.replace("\n", "") for line in log_files if 'testboard.xml' in line]
69 text = open(log_testboard[0], "r").read()
71 if '<session name="PY_test_withKernel">' in text:
73 self.assertEqual(OK, 'OK')
76 # Test the sat -h test
81 if "The test command runs a test base on a SALOME installation" in test.description():
83 self.assertEqual(OK, "OK")
86 if __name__ == '__main__':