summaryrefslogtreecommitdiff
path: root/tests/test_interact.py
diff options
context:
space:
mode:
authorJeff Quast <contact@jeffquast.com>2015-09-18 12:38:58 -0700
committerJeff Quast <contact@jeffquast.com>2015-09-18 12:38:58 -0700
commitfaff3e605b2e1d6d30d3f9ded95473ccfbb8daf0 (patch)
tree9d0347210f6b2fc31b1b330b2ba27dd24eb7c90a /tests/test_interact.py
parentcde8e15893edd87c61acf0515fd217554d21ce51 (diff)
downloadpexpect-git-faff3e605b2e1d6d30d3f9ded95473ccfbb8daf0.tar.gz
Allow {p}.interact(escape_character=None)
For those who wish to disable the ability to escape using escape_character until normal process termination, they may now set the value of escape_character to None. Some of the related docstring on escape_character was made more brief and clear about its related value behavior. This closes #131 #132 #167
Diffstat (limited to 'tests/test_interact.py')
-rwxr-xr-xtests/test_interact.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test_interact.py b/tests/test_interact.py
index e635cb0..86a5b7c 100755
--- a/tests/test_interact.py
+++ b/tests/test_interact.py
@@ -57,6 +57,21 @@ class InteractTestCase (PexpectTestCase.PexpectTestCase):
assert not p.isalive()
assert p.exitstatus == 0
+ def test_interact_escape_None(self):
+ " Return only after Termination when `escape_character=None'. "
+ p = pexpect.spawn('{self.interact_py} --no-escape'.format(self=self),
+ timeout=5, env=self.env)
+ p.expect('<in >')
+ p.sendcontrol(']')
+ p.sendline('')
+ p.expect('<out>\x1d')
+ p.sendcontrol('d')
+ p.expect('<eof>')
+ p.expect_exact('Escaped interact')
+ p.expect(pexpect.EOF)
+ assert not p.isalive()
+ assert p.exitstatus == 0
+
def test_interact_spawn_eof(self):
" Ensure subprocess receives EOF and exit. "
p = pexpect.spawn(self.interact_py, timeout=5, env=self.env)