summaryrefslogtreecommitdiff
path: root/python/test/Ice/ami/Client.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/test/Ice/ami/Client.py')
-rwxr-xr-xpython/test/Ice/ami/Client.py49
1 files changed, 15 insertions, 34 deletions
diff --git a/python/test/Ice/ami/Client.py b/python/test/Ice/ami/Client.py
index a86843fe746..87654db0486 100755
--- a/python/test/Ice/ami/Client.py
+++ b/python/test/Ice/ami/Client.py
@@ -8,43 +8,24 @@
#
# **********************************************************************
-import os, sys, traceback
-import Ice
-
-import Ice
-slice_dir = Ice.getSliceDir()
-if not slice_dir:
- print(sys.argv[0] + ': Slice directory not found.')
- sys.exit(1)
-
-Ice.loadSlice("'-I" + slice_dir + "' Test.ice")
+from TestHelper import TestHelper
+TestHelper.loadSlice("Test.ice")
import AllTests
-def test(b):
- if not b:
- raise RuntimeError('test assertion failed')
-
-def run(args, communicator):
- AllTests.allTests(communicator, False)
- AllTests.allTestsFuture(communicator, False)
- return True
-try:
- initData = Ice.InitializationData()
- initData.properties = Ice.createProperties(sys.argv)
- initData.properties.setProperty('Ice.Warn.AMICallback', '0')
- initData.properties.setProperty('Ice.Warn.Connections', '0')
+class Client(TestHelper):
- #
- # Limit the send buffer size, this test relies on the socket
- # send() blocking after sending a given amount of data.
- #
- initData.properties.setProperty("Ice.TCP.SndSize", "50000");
+ def run(self, args):
+ properties = self.createTestProperties(args)
+ properties.setProperty('Ice.Warn.AMICallback', '0')
+ 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
+ #
+ # Limit the send buffer size, this test relies on the socket
+ # send() blocking after sending a given amount of data.
+ #
+ properties.setProperty("Ice.TCP.SndSize", "50000")
-sys.exit(not status)
+ with self.initialize(properties=properties) as communicator:
+ AllTests.allTests(self, communicator, False)
+ AllTests.allTestsFuture(self, communicator, False)