summaryrefslogtreecommitdiff
path: root/python/test/Slice/structure/Client.py
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2018-08-06 11:56:42 +0200
committerJose <jose@zeroc.com>2018-08-06 11:56:42 +0200
commit7972f07a3aa244dcde673b7cb5541e70da9193bb (patch)
tree117faced1bb36ac256c7d362e11ac1c49e8e8c88 /python/test/Slice/structure/Client.py
parentUpdate JavaScript tests to use TestHelper class (diff)
downloadice-7972f07a3aa244dcde673b7cb5541e70da9193bb.tar.bz2
ice-7972f07a3aa244dcde673b7cb5541e70da9193bb.tar.xz
ice-7972f07a3aa244dcde673b7cb5541e70da9193bb.zip
Python test suite updates
Diffstat (limited to 'python/test/Slice/structure/Client.py')
-rwxr-xr-xpython/test/Slice/structure/Client.py34
1 files changed, 10 insertions, 24 deletions
diff --git a/python/test/Slice/structure/Client.py b/python/test/Slice/structure/Client.py
index 46820ea2289..a6aabfe9aaf 100755
--- a/python/test/Slice/structure/Client.py
+++ b/python/test/Slice/structure/Client.py
@@ -8,24 +8,18 @@
#
# **********************************************************************
-import os, sys, traceback
+from TestHelper import TestHelper
+TestHelper.loadSlice('Test.ice')
+import sys
+import copy
+import Test
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "python", "Ice", "__init__.py")):
- break
-else:
- raise RuntimeError("can't find toplevel directory!")
-
-import Ice
-
-Ice.loadSlice('Test.ice')
-import Test, copy
def test(b):
if not b:
raise RuntimeError('test assertion failed')
+
def allTests(communicator):
sys.stdout.write("testing equals() for Slice structures... ")
sys.stdout.flush()
@@ -187,18 +181,10 @@ def allTests(communicator):
print("ok")
-def run(args, communicator):
- allTests(communicator)
- return True
+class Client(TestHelper):
-try:
- initData = Ice.InitializationData()
- initData.properties = Ice.createProperties(sys.argv)
- with Ice.initialize(sys.argv, initData) as communicator:
- status = run(sys.argv, communicator)
-except:
- traceback.print_exc()
- status = False
+ def run(self, args):
-sys.exit(not status)
+ with self.initialize(args=args) as communicator:
+ allTests(communicator)