Lines Matching refs:Mock
43 instance = mock.Mock()
45 testsuite = mock.Mock()
53 platform = mock.Mock()
128 instance.testcases = [mock.Mock()]
130 handler = Handler(mocked_instance, 'build', mock.Mock())
135 harness.detected_suite_names = mock.Mock()
138 harness.recording = mock.Mock()
140 handler_time = mock.Mock()
179 handler_time = mock.Mock()
182 handler = Handler(instance, 'build', mock.Mock())
197 instance.testcases = [mock.Mock()]
199 handler = Handler(mocked_instance, 'build', mock.Mock())
204 handler_time = mock.Mock()
223 handler = Handler(instance, 'build', mock.Mock())
225 mock_process = mock.Mock()
226 mock_child1 = mock.Mock(pid=1)
227 mock_child2 = mock.Mock(pid=2)
228 mock_process.children = mock.Mock(return_value=[mock_child1, mock_child2])
230 mock_proc = mock.Mock(pid=0)
231 mock_proc.terminate = mock.Mock(return_value=None)
232 mock_proc.kill = mock.Mock(return_value=None)
237 mock.Mock(side_effect=mock_kill_function)
248 mock_child_neg1 = mock.Mock(pid=-1)
249 mock_process.children = mock.Mock(
269 handler = BinaryHandler(instance, 'build', mock.Mock())
274 mock.Mock(side_effect=mock_kill_function)
276 mock.patch('os.unlink', mock.Mock()) as mock_unlink:
301 mock.Mock(status=TwisterStatus.NONE, capture_coverage=False),
321 mock.Mock(status=TwisterStatus.PASS, capture_coverage=False),
329 mock.Mock(status=TwisterStatus.PASS, capture_coverage=False),
337 mock.Mock(status=TwisterStatus.PASS, capture_coverage=True),
366 class MockStdout(mock.Mock):
381 class MockProc(mock.Mock):
391 handler = BinaryHandler(mocked_instance, 'build', mock.Mock(timeout_multiplier=1))
392 handler.terminate = mock.Mock()
481 handler = BinaryHandler(mocked_instance, 'build', mock.Mock(
535 handler = BinaryHandler(mocked_instance, 'build', mock.Mock(
541 missing_mock = mock.Mock()
543 mocked_harness = mock.Mock(status=harness_status, reason="foobar")
574 thread_mock_obj = mock.Mock()
577 return mock.Mock(
578 __enter__=mock.Mock(return_value=mock.Mock(pid=0, returncode=0)),
579 __exit__=mock.Mock(return_value=None)
585 handler = BinaryHandler(mocked_instance, 'build', mock.Mock(coverage=coverage))
589 handler._create_command = mock.Mock(return_value=['dummy' , 'command'])
590 handler._create_env = mock.Mock(return_value=[])
591 handler._update_instance_info = mock.Mock()
592 handler._final_handle_actions = mock.Mock()
593 handler.terminate = mock.Mock()
594 handler.try_kill_process_by_pid = mock.Mock()
596 robot_mock = mock.Mock()
597 harness = mock.Mock(is_robot_test=is_robot_test, run_robot_test=robot_mock)
599 popen_mock = mock.Mock(side_effect=mock_popen)
600 thread_mock = mock.Mock(side_effect=mock_thread)
601 call_mock = mock.Mock()
642 handler = SimulationHandler(mocked_instance, type_str, mock.Mock())
706 halt_event = mock.Mock(is_set=mock.Mock(side_effect=is_set_iter))
707 ser = mock.Mock(
708 isOpen=mock.Mock(side_effect=is_open_iter),
709 readline=mock.Mock(side_effect=line_iter)
715 harness = mock.Mock(capture_coverage=False)
718 handler = DeviceHandler(mocked_instance, 'build', mock.Mock(enable_coverage=not end_by_status))
734 halt_event = mock.Mock(is_set=mock.Mock(return_value=False))
735 ser = mock.Mock(
736 isOpen=mock.Mock(side_effect=[True, True, False]),
737 in_waiting=mock.Mock(return_value=False),
738 readline=mock.Mock(return_value='\nline1\nline2\n'.encode('utf-8'))
740 harness = mock.Mock(status=TwisterStatus.PASS)
742 handler = DeviceHandler(mocked_instance, 'build', mock.Mock(enable_coverage=False))
755 mock.Mock(
760 counter_increment=mock.Mock(),
763 mock.Mock(
768 counter_increment=mock.Mock(),
771 mock.Mock(
778 counter_increment=mock.Mock(),
781 mock.Mock(
784 serial_pty=mock.Mock(),
787 counter_increment=mock.Mock(),
790 mock.Mock(
793 serial_pty=mock.Mock(),
796 counter_increment=mock.Mock(),
806 mock.Mock(
811 counter_increment=mock.Mock(),
814 mock.Mock(
819 counter_increment=mock.Mock(),
822 mock.Mock(
829 counter_increment=mock.Mock(),
832 mock.Mock(
835 serial_pty=mock.Mock(),
838 counter_increment=mock.Mock(),
841 mock.Mock(
844 serial_pty=mock.Mock(),
847 counter_increment=mock.Mock(),
863 mock.Mock(
866 serial_pty=mock.Mock(),
867 counter_increment=mock.Mock(),
871 mock.Mock(
874 serial_pty=mock.Mock(),
875 counter_increment=mock.Mock(),
879 mock.Mock(
882 serial=mock.Mock(),
883 counter_increment=mock.Mock(),
887 mock.Mock(
890 serial=mock.Mock(),
891 counter_increment=mock.Mock(),
917 handler = DeviceHandler(mocked_instance, 'build', mock.Mock())
938 serial = mock.Mock(name='dummy_serial')
940 mock.Mock(available=0, serial=serial, serial_pty=None),
941 mock.Mock(available=0, serial=None, serial_pty=serial),
942 mock.Mock(
944 serial=mock.Mock('another_serial'),
949 handler = DeviceHandler(mocked_instance, 'build', mock.Mock())
965 (mock.Mock(pid=0, returncode=0), False),
966 (mock.Mock(pid=0, returncode=1), False),
967 (mock.Mock(pid=0, returncode=1), True)
980 return mock.Mock(), mock.Mock()
983 return mock.Mock(
984 __enter__=mock.Mock(return_value=mock_process),
985 __exit__=mock.Mock(return_value=None)
988 mock_process.communicate = mock.Mock(side_effect=raise_timeout_fn)
1031 expected_hardware = mock.Mock()
1041 handler = DeviceHandler(mocked_instance, 'build', mock.Mock())
1172 handler = DeviceHandler(mocked_instance, 'build', mock.Mock())
1173 handler.options = mock.Mock(west_flash=self_west_flash)
1179 hardware = mock.Mock(
1213 handler = DeviceHandler(mocked_instance, 'build', mock.Mock())
1215 missing_mock = mock.Mock()
1217 mocked_harness = mock.Mock(status=harness_status, reason="foobar")
1235 mock.Mock(communicate=mock.Mock(return_value=('', ''))),
1273 handler = DeviceHandler(mocked_instance, 'build', mock.Mock(timeout_multiplier=1))
1274 missing_mock = mock.Mock()
1276 twisterlib.handlers.terminate_process = mock.Mock()
1285 serial_mock = mock.Mock(side_effect=mock_serial)
1331 return mock.Mock()
1333 handler = DeviceHandler(mocked_instance, 'build', mock.Mock())
1336 popen_mock = mock.Mock(side_effect=mock_popen)
1337 openpty_mock = mock.Mock(return_value=('master', 'slave'))
1338 ttyname_mock = mock.Mock(side_effect=lambda x: x + ' name')
1392 serial_pty_process = mock.Mock(
1394 communicate=mock.Mock(
1404 return mock.Mock(name='dummy serial')
1407 is_alive_mock = mock.Mock(return_value=bool(do_timeout_thread))
1409 return mock.Mock(is_alive=is_alive_mock)
1412 proc.communicate = mock.Mock(return_value=(mock.Mock(), mock.Mock()))
1417 return mock.Mock(), mock.Mock()
1423 mock_process = mock.Mock(
1426 communicate=mock.Mock(side_effect=mock_communicate)
1429 return mock.Mock(
1430 __enter__=mock.Mock(return_value=mock_process),
1431 __exit__=mock.Mock(return_value=None)
1434 hardware = None if not has_hardware else mock.Mock(
1446 handler = DeviceHandler(mocked_instance, 'build', mock.Mock())
1447 handler.get_hardware = mock.Mock(return_value=hardware)
1448 handler.options = mock.Mock(
1453 handler._get_serial_device = mock.Mock(side_effect=mock_get_serial)
1454 handler._create_command = mock.Mock(return_value=['dummy', 'command'])
1455 handler.run_custom_script = mock.Mock()
1456 handler._create_serial_connection = mock.Mock(
1459 handler.monitor_serial = mock.Mock()
1460 handler.terminate = mock.Mock(side_effect=mock_terminate)
1461 handler._update_instance_info = mock.Mock()
1462 handler._final_handle_actions = mock.Mock()
1463 handler.make_dut_available = mock.Mock()
1464 twisterlib.handlers.terminate_process = mock.Mock()
1467 harness = mock.Mock()
1471 mock.patch('threading.Event', mock.Mock()), \
1522 handler = QEMUHandler(mocked_instance, 'build', mock.Mock())
1530 return mock.Mock(
1531 cpu_times=mock.Mock(
1532 return_value=mock.Mock(
1572 get_default_domain_mock = mock.Mock()
1574 domains_mock = mock.Mock(get_default_domain=get_default_domain_mock)
1575 from_file_mock = mock.Mock(return_value=domains_mock)
1577 handler = QEMUHandler(mocked_instance, 'build', mock.Mock())
1614 unlink_mock = mock.Mock()
1615 exists_mock = mock.Mock(return_value=exists_pid_fn)
1617 handler = QEMUHandler(mocked_instance, 'build', mock.Mock())
1640 handler = QEMUHandler(mocked_instance, 'build', mock.Mock(), 'dummy_cmd', False)
1719 mocked_instance.add_missing_case_status = mock.Mock()
1721 mocked_harness = mock.Mock(status=harness_status, reason="foobar")
1723 handler = QEMUHandler(mocked_instance, 'build', mock.Mock())
1767 handler = QEMUHandler(mocked_instance, 'build', mock.Mock())
1892 handler = QEMUHandler(mocked_instance, 'build', mock.Mock(timeout_multiplier=1))
1914 harness = mock.Mock(capture_coverage=capture_coverage, handle=print)
1917 p = mock.Mock()
1918 p.poll = mock.Mock(
1922 mock_thread_get_fifo_names = mock.Mock(
1925 mock_thread_update_instance_info = mock.Mock()
1931 mock.patch('os.unlink', mock.Mock()), \
1932 mock.patch('os.mkfifo', mock.Mock()), \
1933 mock.patch('os.kill', mock.Mock()), \
1989 mock_process = mock.Mock(pid=0, returncode=1)
1990 mock_process.communicate = mock.Mock(
1991 return_value=(mock.Mock(), mock.Mock())
1993 mock_process.wait = mock.Mock(side_effect=mock_wait)
1995 handler = QEMUHandler(mocked_instance, 'build', mock.Mock(timeout_multiplier=1))
2001 return mock.Mock(
2002 __enter__=mock.Mock(return_value=mock_process),
2003 __exit__=mock.Mock(return_value=None),
2004 communicate=mock.Mock(return_value=(mock.Mock(), mock.Mock()))
2008 return mock.Mock()
2015 harness = mock.Mock(status=harness_status)
2021 handler.options = mock.Mock(
2026 handler.run_custom_script = mock.Mock(return_value=None)
2027 handler.make_device_available = mock.Mock(return_value=None)
2028 handler._final_handle_actions = mock.Mock(return_value=None)
2029 handler._create_command = mock.Mock(return_value=command)
2030 handler._set_qemu_filenames = mock.Mock(side_effect=mock_filenames)
2031 handler.get_default_domain_build_dir = mock.Mock(return_value=domain_build_dir)
2032 handler.terminate = mock.Mock()
2034 unlink_mock = mock.Mock()
2048 handler = QEMUHandler(mocked_instance, 'build', mock.Mock(timeout_multiplier=1))