summaryrefslogtreecommitdiff
path: root/py/test/Ice/exceptions/ServerAMD.py
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2013-07-10 16:52:09 -0700
committerMark Spruiell <mes@zeroc.com>2013-07-10 16:52:09 -0700
commitf4d9d23db92d3aa5d4d2d10b090edf377d5fa019 (patch)
tree31963e4d9045f60bce843a78d99a85ea2f5154c8 /py/test/Ice/exceptions/ServerAMD.py
parentUpdate dependencies (diff)
downloadice-f4d9d23db92d3aa5d4d2d10b090edf377d5fa019.tar.bz2
ice-f4d9d23db92d3aa5d4d2d10b090edf377d5fa019.tar.xz
ice-f4d9d23db92d3aa5d4d2d10b090edf377d5fa019.zip
ICE-5372 - validate argument to ice_exception in Python
Diffstat (limited to 'py/test/Ice/exceptions/ServerAMD.py')
-rwxr-xr-xpy/test/Ice/exceptions/ServerAMD.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/py/test/Ice/exceptions/ServerAMD.py b/py/test/Ice/exceptions/ServerAMD.py
index 41b3fb3675e..36345b1e040 100755
--- a/py/test/Ice/exceptions/ServerAMD.py
+++ b/py/test/Ice/exceptions/ServerAMD.py
@@ -19,6 +19,10 @@ if not slice_dir:
Ice.loadSlice('"-I' + slice_dir + '" TestAMD.ice')
import Test
+def test(b):
+ if not b:
+ raise RuntimeError('test assertion failed')
+
class ThrowerI(Test.Thrower):
def shutdown_async(self, cb, current=None):
current.adapter.getCommunicator().shutdown()
@@ -109,6 +113,13 @@ class ThrowerI(Test.Thrower):
cb.ice_exception(Ice.TimeoutException())
def throwNonIceException_async(self, cb, current=None):
+ # Python-specific: make sure the argument is validated.
+ try:
+ cb.ice_exception('foo')
+ test(False)
+ except TypeError:
+ pass
+
cb.ice_exception(RuntimeError("12345"))
def throwAssertException_async(self, cb, current=None):