diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2007-08-15 13:59:55 -0230 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2007-08-15 13:59:55 -0230 |
commit | 1d265d0027c43825a0dd9567589758713a27452c (patch) | |
tree | 207e11aba123ed504311ba5b988b79d151852704 /demoscript/Ice/async.py | |
parent | Added missing file (diff) | |
download | ice-1d265d0027c43825a0dd9567589758713a27452c.tar.bz2 ice-1d265d0027c43825a0dd9567589758713a27452c.tar.xz ice-1d265d0027c43825a0dd9567589758713a27452c.zip |
Added expect scripts
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" |