summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Quast <contact@jeffquast.com>2015-02-14 17:45:52 -0800
committerJeff Quast <contact@jeffquast.com>2015-02-14 17:45:52 -0800
commite13d4a786d1c012839c0aaf97303d61c113ce10f (patch)
tree942d8065d227474932b1ec8ef60570dbf8b9e5ed
parentcaca6e2d3a4562e365187a5b687bb973025a9895 (diff)
downloadpexpect-e13d4a786d1c012839c0aaf97303d61c113ce10f.tar.gz
Negative test: ensure TypeError is raised.
-rwxr-xr-xtests/test_run.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/test_run.py b/tests/test_run.py
index 28c3945..b736ec4 100755
--- a/tests/test_run.py
+++ b/tests/test_run.py
@@ -136,7 +136,15 @@ class RunFuncTestCase(PexpectTestCase.PexpectTestCase):
timeout=10)
assert exitstatus == 0
- def method_events_callback(self, d):
+ def test_run_event_typeerror(self):
+ events = [('GO:', -1)]
+ with self.assertRaises(TypeError):
+ pexpect.run('bash --rcfile {0}'.format(self.rcfile),
+ withexitstatus=True,
+ events=events,
+ timeout=10)
+
+ def _method_events_callback(self, d):
try:
previous_echoed = (d["child_result_list"][-1].decode()
.split("\n")[-2].strip())