|
8 | 8 |
|
9 | 9 |
|
10 | 10 | class TestScriptHelper(unittest.TestCase): |
11 | | - def test_assert_python_expect_success(self): |
12 | | - t = script_helper._assert_python(True, '-c', 'import sys; sys.exit(0)') |
| 11 | + |
| 12 | + def test_assert_python_ok(self): |
| 13 | + t = script_helper.assert_python_ok('-c', 'import sys; sys.exit(0)') |
13 | 14 | self.assertEqual(0, t[0], 'return code was not 0') |
14 | 15 |
|
15 | | - def test_assert_python_expect_failure(self): |
| 16 | + def test_assert_python_failure(self): |
16 | 17 | # I didn't import the sys module so this child will fail. |
17 | | - rc, out, err = script_helper._assert_python(False, '-c', 'sys.exit(0)') |
| 18 | + rc, out, err = script_helper.assert_python_failure('-c', 'sys.exit(0)') |
18 | 19 | self.assertNotEqual(0, rc, 'return code should not be 0') |
19 | 20 |
|
20 | | - def test_assert_python_raises_expect_success(self): |
| 21 | + def test_assert_python_ok_raises(self): |
21 | 22 | # I didn't import the sys module so this child will fail. |
22 | 23 | with self.assertRaises(AssertionError) as error_context: |
23 | | - script_helper._assert_python(True, '-c', 'sys.exit(0)') |
| 24 | + script_helper.assert_python_ok('-c', 'sys.exit(0)') |
24 | 25 | error_msg = str(error_context.exception) |
25 | 26 | self.assertIn('command line was:', error_msg) |
26 | 27 | self.assertIn('sys.exit(0)', error_msg, msg='unexpected command line') |
27 | 28 |
|
28 | | - def test_assert_python_raises_expect_failure(self): |
| 29 | + def test_assert_python_failure_raises(self): |
29 | 30 | with self.assertRaises(AssertionError) as error_context: |
30 | | - script_helper._assert_python(False, '-c', 'import sys; sys.exit(0)') |
| 31 | + script_helper.assert_python_failure('-c', 'import sys; sys.exit(0)') |
31 | 32 | error_msg = str(error_context.exception) |
32 | 33 | self.assertIn('Process return code is 0,', error_msg) |
33 | 34 | self.assertIn('import sys; sys.exit(0)', error_msg, |
|
0 commit comments