1 # Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
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.
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.
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
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 # Test functionality of HELLO module
24 # initialize salome session
28 # get reference to the HELLO engine
30 hello = salome.lcc.FindOrLoadComponent('FactoryServer', 'HELLO')
33 print "Say hello to John: should be OK"
34 if hello.hello(salome.myStudy, "John") != HELLO_ORB.OP_OK:
35 print "ERROR: wrong operation code is returned"
38 print "Say hello to John: should answer 'already met'"
39 if hello.hello(salome.myStudy, "John") != HELLO_ORB.OP_ERR_ALREADY_MET:
40 print "ERROR: wrong operation code is returned"
43 print "Say goodbye to Margaret: should answer 'did not meet yet'"
44 if hello.goodbye(salome.myStudy, "Margaret") != HELLO_ORB.OP_ERR_DID_NOT_MEET:
45 print "ERROR: wrong operation code is returned"
48 print "Say hello to John: should be OK"
49 if hello.goodbye(salome.myStudy, "John") != HELLO_ORB.OP_OK:
50 print "ERROR: wrong operation code is returned"
53 print "Say hello to John: should answer 'did not meet yet'"
54 if hello.goodbye(salome.myStudy, "John") != HELLO_ORB.OP_ERR_DID_NOT_MEET:
55 print "ERROR: wrong operation code is returned"