Lines Matching refs:self

13     def test_assert_python_ok(self):
15 self.assertEqual(0, t[0], 'return code was not 0')
17 def test_assert_python_failure(self):
20 self.assertNotEqual(0, rc, 'return code should not be 0')
22 def test_assert_python_ok_raises(self):
24 with self.assertRaises(AssertionError) as error_context:
27 self.assertIn('command line:', error_msg)
28 self.assertIn('sys.exit(0)', error_msg, msg='unexpected command line')
30 def test_assert_python_failure_raises(self):
31 with self.assertRaises(AssertionError) as error_context:
34 self.assertIn('Process return code is 0\n', error_msg)
35 self.assertIn('import sys; sys.exit(0)', error_msg,
39 def test_assert_python_isolated_when_env_not_required(self, mock_popen):
47 self.assertEqual('bail out of unittest', err.args[0])
48 self.assertEqual(1, mock_popen.call_count)
49 self.assertEqual(1, mock_ire_func.call_count)
51 self.assertEqual(sys.executable, popen_command[0])
52 self.assertIn('None', popen_command)
53 self.assertIn('-I', popen_command)
54 self.assertNotIn('-E', popen_command) # -I overrides this
57 def test_assert_python_not_isolated_when_env_is_required(self, mock_popen):
66 self.assertEqual('bail out of unittest', err.args[0])
68 self.assertNotIn('-I', popen_command)
69 self.assertNotIn('-E', popen_command)
76 def setUp(self):
77 self.assertTrue(
82 def tearDown(self):
87 def test_interpreter_requires_environment_true(self, mock_check_call):
91 self.assertTrue(script_helper.interpreter_requires_environment())
92 self.assertTrue(script_helper.interpreter_requires_environment())
93 self.assertEqual(1, mock_check_call.call_count)
96 def test_interpreter_requires_environment_false(self, mock_check_call):
101 self.assertFalse(script_helper.interpreter_requires_environment())
102 self.assertEqual(1, mock_check_call.call_count)
105 def test_interpreter_requires_environment_details(self, mock_check_call):
109 self.assertFalse(script_helper.interpreter_requires_environment())
110 self.assertFalse(script_helper.interpreter_requires_environment())
111 self.assertEqual(1, mock_check_call.call_count)
113 self.assertEqual(sys.executable, check_call_command[0])
114 self.assertIn('-E', check_call_command)
117 def test_interpreter_requires_environment_with_pythonhome(self, mock_check_call):
120 self.assertTrue(script_helper.interpreter_requires_environment())
121 self.assertTrue(script_helper.interpreter_requires_environment())
122 self.assertEqual(0, mock_check_call.call_count)