summaryrefslogtreecommitdiff
path: root/pexpect/tests/test_middle_buffer.py
diff options
context:
space:
mode:
authornoah <noah@656d521f-e311-0410-88e0-e7920216d269>2002-08-13 12:11:39 +0000
committernoah <noah@656d521f-e311-0410-88e0-e7920216d269>2002-08-13 12:11:39 +0000
commitb5fb29a11e8cbdff20ec1d0a7a940ed065055c08 (patch)
tree7d0d9050cce04f2efa9b57be8b7e6d1b369addba /pexpect/tests/test_middle_buffer.py
parentf5a4fdf25a59020794583dc401e5c56f0543648e (diff)
downloadpexpect-b5fb29a11e8cbdff20ec1d0a7a940ed065055c08.tar.gz
Initial revision
git-svn-id: http://pexpect.svn.sourceforge.net/svnroot/pexpect/trunk@3 656d521f-e311-0410-88e0-e7920216d269
Diffstat (limited to 'pexpect/tests/test_middle_buffer.py')
-rwxr-xr-xpexpect/tests/test_middle_buffer.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/pexpect/tests/test_middle_buffer.py b/pexpect/tests/test_middle_buffer.py
new file mode 100755
index 0000000..ccb8302
--- /dev/null
+++ b/pexpect/tests/test_middle_buffer.py
@@ -0,0 +1,30 @@
+#!/usr/bin/env python2
+import expyct
+import time
+
+e = expyct.expyct ('/bin/sh -i')
+e.timeout=60
+e.expect(['#', '\$'])
+e.send ('ls -la /\n')
+
+i = e.expect (['foo','(d[aeiou]v)'])
+print '\nRead before match>%s<' % e.before
+print 'Matched:>%s<' % e.matched
+print 'index:', i
+
+i = e.expect(['#', '\$'])
+print '\nRead before match>%s<' % e.before
+print 'Matched:>%s<' % e.matched
+print 'index:', i
+e.send('exit\n')
+print 'Sent exit'
+time.sleep(2)
+print 'isAlive:', e.isAlive()
+
+# This should test timeout...
+i = e.expect ('#####')
+print '\nRead before match>%s<' % e.before
+print 'Matched:>%s<' % e.matched
+print 'index:', i
+
+