diff options
Diffstat (limited to 'demoscript/Ice/async.py')
-rwxr-xr-x | demoscript/Ice/async.py | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/demoscript/Ice/async.py b/demoscript/Ice/async.py new file mode 100755 index 00000000000..aa1449db294 --- /dev/null +++ b/demoscript/Ice/async.py @@ -0,0 +1,39 @@ +#!/usr/bin/env python +# ********************************************************************** +# +# Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. +# +# This copy of Ice is licensed to you under the terms described in the +# ICE_LICENSE file included in this distribution. +# +# ********************************************************************** + +import pexpect, sys + +def run(client, server): + print "testing client... ", + sys.stdout.flush() + client.sendline('i') + server.expect('Hello World!') + client.sendline('d') + try: + server.expect('Hello World!', timeout=1) + except pexpect.TIMEOUT: + pass + client.sendline('i') + server.expect('Hello World!') + server.expect('Hello World!') + print "ok" + + print "testing shutdown... ", + sys.stdout.flush() + client.sendline('d') + client.sendline('s') + server.expect(pexpect.EOF) + assert server.wait() == 0 + + client.expect('RequestCanceledException') + client.sendline('x') + client.expect(pexpect.EOF) + assert client.wait() == 0 + print "ok" |