Salome HOME
Merge tag 'V8_3_0a2' into ngr/python3_dev
[modules/kernel.git] / bin / appliskel / tests / salomeCommand / TestLauncherSimple.py
1 # Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
2 #
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
7 #
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 # Lesser General Public License for more details.
12 #
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 #
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 #
19
20 import unittest
21 import logging
22
23 class TestLauncher(unittest.TestCase):
24
25   def setUp(self):
26     from salome_instance import SalomeInstance
27     self.instance = SalomeInstance.start()
28     print("Instance created and now running on port", self.instance.get_port())
29    #
30
31   def tearDown(self):
32     print("Terminate instance running on port", self.instance.get_port())
33     self.instance.stop()
34   #
35
36   def testHello(self):
37     try:
38       import setenv
39       setenv.main(True)
40       import runSession
41       args = ["hello.py"]
42       params, args = runSession.configureSession(args, exe="salome shell")
43       return runSession.runSession(params, args)
44     except SystemExit as e:
45       if str(e) != '0':
46         logging.error(e)
47   #
48 #
49
50 if __name__ == "__main__":
51   unittest.main()
52 #