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/value.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/value.py')
-rwxr-xr-x | demoscript/Ice/value.py | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/demoscript/Ice/value.py b/demoscript/Ice/value.py new file mode 100755 index 00000000000..9abacc8b3e1 --- /dev/null +++ b/demoscript/Ice/value.py @@ -0,0 +1,48 @@ +#!/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, ruby = False): + print "testing...", + sys.stdout.flush() + client.expect('press enter') + client.sendline('') + client.expect('==> a message 4 u.*press enter') + client.sendline('') + if not ruby: + client.expect('NoObjectFactoryException.*press enter') + client.sendline('') + client.expect('==> Ice rulez!.*press enter') + client.sendline('') + client.expect('==> !zelur ecI.*press enter') + client.sendline('') + client.expect('press enter') + server.expect('!zelur ecI') + client.sendline('') + if ruby: + client.expect('==> The type ID of the received object is "::Demo::DerivedPrinter".*press enter') + client.sendline('') + client.expect('==> undefined method') + client.sendline('') + else: + client.expect('==> The type ID of the received object is "::Demo::Printer".*press enter') + client.sendline('') + client.expect('==> The type ID of the received object is "::Demo::DerivedPrinter".*press enter') + client.sendline('') + client.expect('==> a derived message 4 u\r{1,2}\n==> A DERIVED MESSAGE 4 U.*press enter') + client.sendline('') + client.expect('==> a derived message 4 u\r{1,2}\n==> A DERIVED MESSAGE 4 U') + print "ok" + + server.expect(pexpect.EOF) + assert server.wait() == 0 + client.expect(pexpect.EOF) + assert client.wait() == 0 |