Show More
@@ -21,7 +21,8 b' from unittest import TestCase' | |||
|
21 | 21 | import nose.tools as nt |
|
22 | 22 | |
|
23 | 23 | from IPython.utils.process import (find_cmd, FindCmdError, arg_split, |
|
24 |
system, getoutput, getoutputerror |
|
|
24 | system, getoutput, getoutputerror, | |
|
25 | get_output_error_code) | |
|
25 | 26 | from IPython.testing import decorators as dec |
|
26 | 27 | from IPython.testing import tools as tt |
|
27 | 28 | |
@@ -132,3 +133,14 b' class SubProcessTestCase(TestCase, tt.TempFileMixin):' | |||
|
132 | 133 | out, err = getoutputerror('%s "%s"' % (python, self.fname)) |
|
133 | 134 | self.assertEqual(out, 'on stdout') |
|
134 | 135 | self.assertEqual(err, 'on stderr') |
|
136 | ||
|
137 | def test_get_output_error_code(self): | |
|
138 | quiet_exit = '%s -c "import sys; sys.exit(1)"' % python | |
|
139 | out, err, code = get_output_error_code(quiet_exit) | |
|
140 | self.assertEqual(out, '') | |
|
141 | self.assertEqual(err, '') | |
|
142 | self.assertEqual(code, 1) | |
|
143 | out, err, code = get_output_error_code('%s "%s"' % (python, self.fname)) | |
|
144 | self.assertEqual(out, 'on stdout') | |
|
145 | self.assertEqual(err, 'on stderr') | |
|
146 | self.assertEqual(code, 0) |
General Comments 0
You need to be logged in to leave comments.
Login now