Lines Matching refs:mock
9 import mock
153 with mock.patch('sys.argv', ['twister'] + args):
159 which_mock = mock.Mock(side_effect=mock_which)
161 with mock.patch('os.name', os_name) \
163 mock.patch('shutil.which', which_mock) \
165 mock.patch('twisterlib.environment' \
180 with mock.patch('sys.argv', ['twister'] + args):
183 mock_calc_parent = mock.Mock()
184 mock_calc_parent.child = mock.Mock(return_value=mock.Mock())
189 with mock.patch('twisterlib.size_calc.SizeCalculator', mock_calc):
195 mock_calc_parent.child.assert_has_calls([mock.call(('dummy.elf', []), {})])
196 mock_calc_parent.child().size_report.assert_has_calls([mock.call()])
202 with mock.patch('sys.argv', ['twister'] + args):
205 with mock.patch('twisterlib.environment.PYTEST_PLUGIN_INSTALLED', True):
227 with mock.patch('sys.argv', ['twister'] + args):
247 mock.Mock(
256 mock.Mock(
264 mock.Mock(
276 mock.Mock(
284 mock.Mock(
308 with mock.patch(
310 mock.Mock(return_value='dummy_abspath')):
323 options = mock.Mock(
327 abspath_mock = mock.Mock(return_value='dummy_abspath')
329 with mock.patch('os.path.abspath', abspath_mock):
332 mock_datetime = mock.Mock(
333 now=mock.Mock(
334 return_value=mock.Mock(
335 isoformat=mock.Mock(return_value='dummy_time')
340 with mock.patch.object(
343 mock.Mock()) as mock_czv, \
344 mock.patch.object(
347 mock.Mock()) as mock_gt, \
348 mock.patch('twisterlib.environment.datetime', mock_datetime):
358 mock.Mock(returncode=0, stdout='dummy stdout version'),
359 mock.Mock(returncode=0, stdout='dummy stdout date'),
365 mock.Mock(returncode=0, stdout=''),
366 mock.Mock(returncode=0, stdout='dummy stdout date'),
372 mock.Mock(returncode=1, stdout='dummy stdout version'),
373 mock.Mock(returncode=0, stdout='dummy stdout date'),
380 mock.Mock(returncode=1),
419 options = mock.Mock(
423 abspath_mock = mock.Mock(return_value='dummy_abspath')
425 with mock.patch('os.path.abspath', abspath_mock):
428 with mock.patch('subprocess.run', mock.Mock(side_effect=mock_run)):
490 return mock.Mock(
493 communicate=mock.Mock(
500 with mock.patch('shutil.which', mock_which), \
501 mock.patch('subprocess.Popen', mock.Mock(side_effect=mock_popen)), \
539 options = mock.Mock(
543 abspath_mock = mock.Mock(return_value='dummy_abspath')
545 with mock.patch('os.path.abspath', abspath_mock):
548 with mock.patch.object(
551 mock.Mock(return_value=script_result)), \