diff options
author | jquast <contact@jeffquast.com> | 2013-09-23 09:28:46 -0700 |
---|---|---|
committer | jquast <contact@jeffquast.com> | 2013-09-23 09:28:46 -0700 |
commit | bb40bdd435f482c9eaa2047e91a44f6c522f743c (patch) | |
tree | 3a5ad59740d1afb3fe764cdbbdc085cdc1ee1118 /tests/test_ctrl_chars.py | |
parent | 247629fba2ee92e7920714cce01a6fce97d04dc9 (diff) | |
download | pexpect-git-bb40bdd435f482c9eaa2047e91a44f6c522f743c.tar.gz |
increase timeout, remove leading ^ from pattern
Diffstat (limited to 'tests/test_ctrl_chars.py')
-rwxr-xr-x | tests/test_ctrl_chars.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/test_ctrl_chars.py b/tests/test_ctrl_chars.py index 32a10ec..1a4e133 100755 --- a/tests/test_ctrl_chars.py +++ b/tests/test_ctrl_chars.py @@ -44,7 +44,7 @@ class TestCtrlChars(PexpectTestCase.PexpectTestCase): for i in range(256): # child.send(unicode('%d'%i, encoding='utf-8')) child.send(chr(i)) - child.expect ('%d\r\n' % i) + child.expect ('%d\r\n' % (i,)) except Exception: err = sys.exc_info()[1] msg = "Did not echo character value: " + str(i) + "\n" @@ -78,9 +78,9 @@ class TestCtrlChars(PexpectTestCase.PexpectTestCase): for ctrl in 'abcdefghijklmnopqrstuvwxyz': assert child.sendcontrol(ctrl) == 1 # Strange: on travis-ci, getch.py actually displays ^A, not '1' !? - child.expect ('^(%d|\^%s)\r\n' % ( - ord(ctrl) - (ord('a') - 1), - ctrl.upper(),), timeout=1) + val = ord(ctrl) - (ord('a') - 1), + alpha = ctrl.upper() + child.expect ('(%d|\^%s)\r\n' % (val, alpha), timeout=2) # escape character assert child.sendcontrol('[') == 1 |