diff options
Diffstat (limited to 'python/test/Slice/structure/Client.py')
-rwxr-xr-x | python/test/Slice/structure/Client.py | 34 |
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) |