Salome HOME
Updated copyright comment
[samples/hello.git] / bin / test_hello.py
old mode 100755 (executable)
new mode 100644 (file)
index 549c702..8174a0f
@@ -1,4 +1,4 @@
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2024  CEA, EDF, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -30,28 +30,28 @@ import HELLO_ORB
 hello = salome.lcc.FindOrLoadComponent('FactoryServer', 'HELLO')
 
 # test HELLO module
-print "Say hello to John: should be OK"
-if hello.hello(salome.myStudy, "John") != HELLO_ORB.OP_OK:
-    print "ERROR: wrong operation code is returned"
+print("Say hello to John: should be OK")
+if hello.hello("John") != HELLO_ORB.OP_OK:
+    print("ERROR: wrong operation code is returned")
 else:
-    print "OK"
-print "Say hello to John: should answer 'already met'"
-if hello.hello(salome.myStudy, "John") != HELLO_ORB.OP_ERR_ALREADY_MET:
-    print "ERROR: wrong operation code is returned"
+    print("OK")
+print("Say hello to John: should answer 'already met'")
+if hello.hello("John") != HELLO_ORB.OP_ERR_ALREADY_MET:
+    print("ERROR: wrong operation code is returned")
 else:
-    print "OK"
-print "Say goodbye to Margaret: should answer 'did not meet yet'"
-if hello.goodbye(salome.myStudy, "Margaret") != HELLO_ORB.OP_ERR_DID_NOT_MEET:
-    print "ERROR: wrong operation code is returned"
+    print("OK")
+print("Say goodbye to Margaret: should answer 'did not meet yet'")
+if hello.goodbye("Margaret") != HELLO_ORB.OP_ERR_DID_NOT_MEET:
+    print("ERROR: wrong operation code is returned")
 else:
-    print "OK"
-print "Say hello to John: should be OK"
-if hello.goodbye(salome.myStudy, "John") != HELLO_ORB.OP_OK:
-    print "ERROR: wrong operation code is returned"
+    print("OK")
+print("Say hello to John: should be OK")
+if hello.goodbye("John") != HELLO_ORB.OP_OK:
+    print("ERROR: wrong operation code is returned")
 else:
-    print "OK"
-print "Say hello to John: should answer 'did not meet yet'"
-if hello.goodbye(salome.myStudy, "John") != HELLO_ORB.OP_ERR_DID_NOT_MEET:
-    print "ERROR: wrong operation code is returned"
+    print("OK")
+print("Say hello to John: should answer 'did not meet yet'")
+if hello.goodbye("John") != HELLO_ORB.OP_ERR_DID_NOT_MEET:
+    print("ERROR: wrong operation code is returned")
 else:
-    print "OK"
+    print("OK")