Salome HOME
7fca21f061903ba35b94aadaaa9e42bcc12e9c80
[modules/smesh.git] / doc / salome / examples / testme.py
1 # Copyright (C) 2007-2014  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 #!/usr/bin/env python
21
22 import unittest, sys, os
23
24 class SalomeSession(object):
25     def __init__(self, script):
26         import runSalome
27         sys.argv  = ["runSalome.py"]
28         sys.argv += ["--terminal"]
29         sys.argv += ["--modules=GEOM,MED,SMESH"]
30         sys.argv += ["%s" % script]
31         clt, d = runSalome.main()
32         return
33
34     def __del__(self):
35         port = os.getenv('NSPORT')
36         import killSalomeWithPort
37         killSalomeWithPort.killMyPort(port)
38         return
39     pass
40
41 class MyTest(unittest.TestCase):
42     def testFunction(self):
43         SalomeSession(sys.argv[1])
44     pass
45
46 unittest.main(argv=sys.argv[:1])