diff options
author | Jose <jose@zeroc.com> | 2018-08-06 11:56:42 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2018-08-06 11:56:42 +0200 |
commit | 7972f07a3aa244dcde673b7cb5541e70da9193bb (patch) | |
tree | 117faced1bb36ac256c7d362e11ac1c49e8e8c88 /python/test/Ice/faultTolerance/Client.py | |
parent | Update JavaScript tests to use TestHelper class (diff) | |
download | ice-7972f07a3aa244dcde673b7cb5541e70da9193bb.tar.bz2 ice-7972f07a3aa244dcde673b7cb5541e70da9193bb.tar.xz ice-7972f07a3aa244dcde673b7cb5541e70da9193bb.zip |
Python test suite updates
Diffstat (limited to 'python/test/Ice/faultTolerance/Client.py')
-rwxr-xr-x | python/test/Ice/faultTolerance/Client.py | 59 |
1 files changed, 18 insertions, 41 deletions
diff --git a/python/test/Ice/faultTolerance/Client.py b/python/test/Ice/faultTolerance/Client.py index 9673fd3b41d..b1f9d8cb981 100755 --- a/python/test/Ice/faultTolerance/Client.py +++ b/python/test/Ice/faultTolerance/Client.py @@ -8,53 +8,30 @@ # # ********************************************************************** -import os, sys, traceback -import Ice, AllTests +from TestHelper import TestHelper +import AllTests -def test(b): - if not b: - raise RuntimeError('test assertion failed') -def usage(n): - sys.stderr.write("Usage: " + n + " port...\n") +class Client(TestHelper): -def run(args, communicator): - ports = [] - for arg in args[1:]: - if arg[0] == '-': - sys.stderr.write(args[0] + ": unknown option `" + arg + "'\n") - usage(args[0]) - return False + def run(self, args): - ports.append(12010 + int(arg)) + properties = self.createTestProperties(args) - if len(ports) == 0: - sys.stderr.write(args[0] + ": no ports specified\n") - usage(args[0]) - return False + # + # This test aborts servers, so we don't want warnings. + # + properties.setProperty('Ice.Warn.Connections', '0') - try: - AllTests.allTests(communicator, ports) - except: - traceback.print_exc() - test(False) + ports = [] + for arg in args: + if arg[0] == '-': + raise RuntimeError("unknown option `" + arg + "'") + ports.append(int(arg)) - return True + if len(ports) == 0: + raise RuntimeError("no ports specified") -try: - initData = Ice.InitializationData() - initData.properties = Ice.createProperties(sys.argv) - - # - # This test aborts servers, so we don't want warnings. - # - initData.properties.setProperty('Ice.Warn.Connections', '0') - - with Ice.initialize(sys.argv, initData) as communicator: - status = run(sys.argv, communicator) -except: - traceback.print_exc() - status = False - -sys.exit(not status) + with self.initialize(properties=properties) as communicator: + AllTests.allTests(self, communicator, ports) |