diff options
author | Jeff Quast <contact@jeffquast.com> | 2015-02-14 17:45:52 -0800 |
---|---|---|
committer | Jeff Quast <contact@jeffquast.com> | 2015-02-14 17:45:52 -0800 |
commit | e13d4a786d1c012839c0aaf97303d61c113ce10f (patch) | |
tree | 942d8065d227474932b1ec8ef60570dbf8b9e5ed | |
parent | caca6e2d3a4562e365187a5b687bb973025a9895 (diff) | |
download | pexpect-e13d4a786d1c012839c0aaf97303d61c113ce10f.tar.gz |
Negative test: ensure TypeError is raised.
-rwxr-xr-x | tests/test_run.py | 10 |
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()) |