Lines Matching full:mock

10 import mock
169 with mock.patch('sys.argv', ['twister'] + args):
175 which_mock = mock.Mock(side_effect=mock_which)
177 with mock.patch('os.name', os_name) \
179 mock.patch('shutil.which', which_mock) \
181 mock.patch('twisterlib.environment' \
196 with mock.patch('sys.argv', ['twister'] + args):
199 mock_calc_parent = mock.Mock()
200 mock_calc_parent.child = mock.Mock(return_value=mock.Mock())
205 with mock.patch('twisterlib.size_calc.SizeCalculator', mock_calc):
211 mock_calc_parent.child.assert_has_calls([mock.call(('dummy.elf', []), {})])
212 mock_calc_parent.child().size_report.assert_has_calls([mock.call()])
218 with mock.patch('sys.argv', ['twister'] + args):
221 with mock.patch('twisterlib.environment.PYTEST_PLUGIN_INSTALLED', True):
243 with mock.patch('sys.argv', ['twister'] + args):
262 mock.Mock(
271 mock.Mock(
283 mock.Mock(
292 mock.Mock(
320 elif isinstance(path, mock.Mock):
325 with mock.patch('os.path.abspath', side_effect=mocked_abspath):
338 options = mock.Mock(
347 elif isinstance(path, mock.Mock):
352 with mock.patch('os.path.abspath', side_effect=mocked_abspath):
355 mock_datetime = mock.Mock(
356 now=mock.Mock(
357 return_value=mock.Mock(
358 isoformat=mock.Mock(return_value='dummy_time')
363 with mock.patch.object(
366 mock.Mock()) as mock_czv, \
367 mock.patch.object(
370 mock.Mock()) as mock_gt, \
371 mock.patch('twisterlib.environment.datetime', mock_datetime):
381 mock.Mock(returncode=0, stdout='dummy stdout version'),
382 mock.Mock(returncode=0, stdout='dummy stdout date'),
388 mock.Mock(returncode=0, stdout=''),
389 mock.Mock(returncode=0, stdout='dummy stdout date'),
395 mock.Mock(returncode=1, stdout='dummy stdout version'),
396 mock.Mock(returncode=0, stdout='dummy stdout date'),
403 mock.Mock(returncode=1),
442 options = mock.Mock(
451 elif isinstance(path, mock.Mock):
456 with mock.patch('os.path.abspath', side_effect=mocked_abspath):
459 with mock.patch('subprocess.run', mock.Mock(side_effect=mock_run)):
521 return mock.Mock(
524 communicate=mock.Mock(
531 with mock.patch('shutil.which', mock_which), \
532 mock.patch('subprocess.Popen', mock.Mock(side_effect=mock_popen)), \
570 options = mock.Mock(
579 elif isinstance(path, mock.Mock):
584 with mock.patch('os.path.abspath', side_effect=mocked_abspath):
587 with mock.patch.object(
590 mock.Mock(return_value=script_result)), \