summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorjquast <contact@jeffquast.com>2014-05-25 09:20:33 -0700
committerjquast <contact@jeffquast.com>2014-05-25 09:20:33 -0700
commite4d63327d2d4890b1ef549f87f0a137e6fa7eb94 (patch)
treebccb3f0614ea282a63e5d57886d02ea95d961ab7 /tests
parent78b16ad8f06ce20b5274a7a7c17f3a8a042edd46 (diff)
downloadpexpect-issue-20-try-2.tar.gz
more naughty attempts, cleaning up, as not to loseissue-20-try-2
Diffstat (limited to 'tests')
-rwxr-xr-xtests/test_constructor.py6
-rwxr-xr-xtests/test_ctrl_chars.py7
-rwxr-xr-xtests/test_expect.py1
3 files changed, 8 insertions, 6 deletions
diff --git a/tests/test_constructor.py b/tests/test_constructor.py
index 8a98c28..a7a427f 100755
--- a/tests/test_constructor.py
+++ b/tests/test_constructor.py
@@ -29,11 +29,11 @@ class TestCaseConstructor(PexpectTestCase.PexpectTestCase):
the same results for different styles of invoking __init__().
This assumes that the root directory / is static during the test.
'''
- p1 = pexpect.spawn('/bin/ls -l /bin')
- p2 = pexpect.spawn('/bin/ls' ,['-l', '/bin'])
+ p1 = pexpect.spawn('/bin/ls -i /bin')
+ p2 = pexpect.spawn('/bin/ls' ,['-i', '/bin'])
p1.expect (pexpect.EOF)
p2.expect (pexpect.EOF)
- assert (p1.before == p2.before)
+ assert (p1.before == p2.before), (p1.before, p2.before)
def test_named_parameters (self):
'''This tests that named parameters work.
diff --git a/tests/test_ctrl_chars.py b/tests/test_ctrl_chars.py
index 336337c..9def111 100755
--- a/tests/test_ctrl_chars.py
+++ b/tests/test_ctrl_chars.py
@@ -39,12 +39,15 @@ class TestCtrlChars(PexpectTestCase.PexpectTestCase):
process.'''
child = pexpect.spawn('python getch.py')
child.expect('READY', timeout=5)
+ i = None
try:
- for i in range(1,256):
+ for i in range(1, 256):
child.send(byte(i))
- child.expect ('%d\r\n' % (i,))
# This needs to be last, as getch.py exits on \x00
child.send(byte(0))
+
+ for i in range(1, 256):
+ child.expect('%d\r\n' % (i,))
child.expect('0\r\n')
child.expect(pexpect.EOF)
except Exception:
diff --git a/tests/test_expect.py b/tests/test_expect.py
index bcaed82..d5d0c9c 100755
--- a/tests/test_expect.py
+++ b/tests/test_expect.py
@@ -460,7 +460,6 @@ class ExpectTestCase (PexpectTestCase.PexpectTestCase):
self.assertEqual(expect([b'1, 2, 3', b'2,']), 1)
def test_greed(self):
- # fails on travis on occasion .. ?
p = pexpect.spawn(self.PYTHONBIN + ' list100.py')
self._greed(p.expect)