Home
last modified time | relevance | path

Searched full:mock (Results 1 – 25 of 138) sorted by relevance

123456

/Zephyr-latest/scripts/tests/twister/
Dtest_handlers.py11 import mock
43 instance = mock.Mock()
45 testsuite = mock.Mock()
46 type(testsuite).source_dir = mock.PropertyMock(return_value='')
51 type(instance).build_dir = mock.PropertyMock(return_value=str(build_dir))
53 platform = mock.Mock()
54 type(platform).binaries = mock.PropertyMock(return_value=[])
57 type(instance.testsuite).timeout = mock.PropertyMock(return_value=60)
58 type(instance.platform).timeout_multiplier = mock.PropertyMock(
116 with mock.patch('os.name', os_name), \
[all …]
Dtest_runner.py10 import mock
41 instance = mock.Mock()
42 testsuite = mock.Mock()
45 platform = mock.Mock()
57 env = mock.Mock()
58 options = mock.Mock()
66 jobserver = mock.Mock()
98 @mock.patch("os.path.exists")
245 testsuite_mock = mock.Mock()
246 platform_mock = mock.Mock()
[all …]
Dtest_jobserver.py10 import mock
78 proc_mock = mock.Mock()
79 popen_mock = mock.Mock(return_value=proc_mock)
82 with mock.patch('subprocess.Popen', popen_mock), \
83 mock.patch('os.environ', env_mock):
104 inherit_read_fd = mock.Mock()
105 inherit_write_fd = mock.Mock()
109 internal_read_fd = mock.Mock()
110 internal_write_fd = mock.Mock()
115 close_mock = mock.Mock()
[all …]
Dtest_environment.py10 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):
[all …]
Dtest_scl.py10 import mock
53 cloader_mock = mock.Mock()
54 loader_mock = mock.Mock()
55 csafeloader_mock = mock.Mock()
56 safeloader_mock = mock.Mock()
57 cdumper_mock = mock.Mock()
58 dumper_mock = mock.Mock()
72 with mock.patch.dict('sys.modules', modules_mock, clear=True), \
73 mock.patch('sys.meta_path', meta_path_mock):
112 with mock.patch.dict('sys.modules', modules_mock, clear=True), \
[all …]
Dtest_testplan.py11 import mock
406 testplan = TestPlan(env=mock.Mock())
407 lvl1 = mock.Mock()
409 lvl2 = mock.Mock()
411 lvl3 = mock.Mock()
425 lvl_missed = mock.Mock()
466 testplan = TestPlan(env=mock.Mock())
499 testplan = TestPlan(env=mock.Mock())
500 testplan.options = mock.Mock(sub_test=sub_tests)
503 'ts1': mock.Mock(
[all …]
Dtest_testinstance.py14 import mock
72 env = mock.Mock(
73 options=mock.Mock(
85 with mock.patch('os.name', 'nt'):
90 # mock path to QEMU binary in QEMU_BIN_PATH environment variable
91 with mock.patch('os.environ', {'QEMU_BIN_PATH': ''}):
241 testinstance.testcases = [mock.Mock()]
245 with mock.patch(
247 mock.mock_open(read_data='')
249 mock.patch(
[all …]
Dtest_hardwaremap.py9 import mock
34 hm = HardwareMap(env=mock.Mock())
44 {'baud': 115200, 'lock': mock.ANY, 'flash_timeout': 60},
70 'lock': mock.ANY,
118 ('ghm.yaml', mock.ANY, mock.ANY, [], mock.ANY, mock.ANY, mock.ANY, 0,
120 (None, False, 'hm.yaml', [], mock.ANY, mock.ANY, mock.ANY, 0,
122 (None, True, 'hm.yaml', [], mock.ANY, mock.ANY, ['fix'], 1,
124 (None, True, 'hm.yaml', ['pX'], mock.ANY, mock.ANY, ['fix'], 1,
167 mocked_hm.scan = mock.Mock()
168 mocked_hm.save = mock.Mock()
[all …]
Dtest_harness.py9 import mock
184 mock.patch.object(Harness, "parse_record", return_value=None)
198 mock_platform = mock.Mock()
202 mock_testsuite = mock.Mock(id="id", testcases=[])
229 mock_platform = mock.Mock()
233 mock_testsuite = mock.Mock(id="id", testcases=[])
272 handler = mock.Mock()
279 mock_platform = mock.Mock()
283 mock_testsuite = mock.Mock(id="id", testcases=[mock.Mock()])
295 open_mock = mock.mock_open()
[all …]
Dtest_testsuite.py10 import mock
264 with mock.patch('mmap.mmap', mock.Mock(side_effect=assert_mmap)), \
265 mock.patch('builtins.open', mock.mock_open(read_data='dummy data')), \
266 mock.patch('os.name', os_name), \
267 mock.patch('contextlib.closing', raise_exception):
386 mock.Mock(
387 start=mock.Mock(return_value=0),
388 end=mock.Mock(return_value=0)
397 mock.Mock(
398 start=mock.Mock(return_value=0),
[all …]
Dtest_config_parser.py12 import mock
67 with mock.patch('builtins.open', mock.mock_open(read_data=yaml_data)):
93 with mock.patch('builtins.open', mock.mock_open(read_data=yaml_data)):
156 with mock.patch('warnings.warn') as warn_mock:
161 warn_mock.assert_called_once_with(*expected_warning, stacklevel=mock.ANY)
176 with mock.patch('builtins.open', mock.mock_open(read_data=yaml_data)):
195 with mock.patch('builtins.open', mock.mock_open(read_data=yaml_data)):
/Zephyr-latest/tests/subsys/modem/mock/
Dmodem_backend_mock.c13 struct modem_backend_mock *mock = (struct modem_backend_mock *)data; in modem_backend_mock_open() local
15 modem_pipe_notify_opened(&mock->pipe); in modem_backend_mock_open()
19 static bool modem_backend_mock_update(struct modem_backend_mock *mock, const uint8_t *buf, in modem_backend_mock_update() argument
22 if (mock->transaction == NULL) { in modem_backend_mock_update()
27 __ASSERT(buf[i] == mock->transaction->get[mock->transaction_match_cnt], in modem_backend_mock_update()
30 mock->transaction_match_cnt++; in modem_backend_mock_update()
31 if (mock->transaction_match_cnt == mock->transaction->get_size) { in modem_backend_mock_update()
41 struct modem_backend_mock *mock = (struct modem_backend_mock *)data; in modem_backend_mock_transmit() local
44 size = (mock->limit < size) ? mock->limit : size; in modem_backend_mock_transmit()
46 if (mock->bridge) { in modem_backend_mock_transmit()
[all …]
Dmodem_backend_mock.h38 /* Mock Brige pair */
50 struct modem_pipe *modem_backend_mock_init(struct modem_backend_mock *mock,
53 void modem_backend_mock_reset(struct modem_backend_mock *mock);
55 int modem_backend_mock_get(struct modem_backend_mock *mock, uint8_t *buf, size_t size);
57 void modem_backend_mock_put(struct modem_backend_mock *mock, const uint8_t *buf, size_t size);
59 void modem_backend_mock_prime(struct modem_backend_mock *mock,
/Zephyr-latest/scripts/build/
Dcheck_init_priorities_test.py9 import mock
58 @mock.patch("check_init_priorities.ZephyrInitLevels.__init__", return_value=None)
60 mock_elf = mock.Mock()
62 sts = mock.Mock(spec=SymbolTableSection)
63 rel = mock.Mock(spec=Section)
66 s0 = mock.Mock()
73 s1 = mock.Mock()
76 s2 = mock.Mock()
91 @mock.patch("check_init_priorities.ZephyrInitLevels.__init__", return_value=None)
93 mock_elf = mock.Mock()
[all …]
/Zephyr-latest/tests/subsys/logging/log_api/src/
Dmock_backend.c13 struct mock_log_backend *mock = backend->cb->ctx; in mock_log_backend_reset() local
15 mock->msg_rec_idx = 0; in mock_log_backend_reset()
16 mock->msg_proc_idx = 0; in mock_log_backend_reset()
17 mock->do_check = true; in mock_log_backend_reset()
18 mock->exp_drop_cnt = 0; in mock_log_backend_reset()
19 mock->drop_cnt = 0; in mock_log_backend_reset()
20 mock->panic = false; in mock_log_backend_reset()
25 struct mock_log_backend *mock = backend->cb->ctx; in mock_log_backend_check_enable() local
27 mock->do_check = true; in mock_log_backend_check_enable()
32 struct mock_log_backend *mock = backend->cb->ctx; in mock_log_backend_check_disable() local
[all …]
Dmock_frontend.c19 static struct mock_log_backend mock; variable
21 .ctx = &mock
35 mock.do_check = true; in mock_log_frontend_check_enable()
40 mock.do_check = false; in mock_log_frontend_check_disable()
90 struct mock_log_backend_msg *exp_msg = &mock.exp_msgs[mock.msg_proc_idx]; in log_frontend_msg()
93 if (mock.do_check == false) { in log_frontend_msg()
97 mock.msg_proc_idx++; in log_frontend_msg()
143 mock.panic = true; in log_frontend_panic()
/Zephyr-latest/scripts/west_commands/tests/
Dtest_canopen_program.py7 from unittest.mock import patch, call
70 mock = cpd.return_value
71 mock.flash_status.return_value = 0
72 mock.wait_for_flash_status_ok.return_value = 0
73 mock.swid.return_value = 0
102 mock.connect.assert_called_once()
105 mock.wait_for_flash_status_ok.assert_called_with(timeout)
106 mock.swid.assert_called_once()
107 mock.enter_pre_operational.assert_called_once()
108 mock.zephyr_confirm_program.assert_called_once()
[all …]
/Zephyr-latest/tests/subsys/logging/log_links/src/
Dmock_log_link.c11 struct mock_log_link *mock = (struct mock_log_link *)link->ctx; in initiate() local
13 link->ctrl_blk->domain_cnt = mock->domain_cnt; in initiate()
15 for (int i = 0; i < mock->domain_cnt; i++) { in initiate()
16 link->ctrl_blk->source_cnt[i] = mock->domains[i]->source_cnt; in initiate()
30 struct mock_log_link *mock = (struct mock_log_link *)link->ctx; in get_domain_name() local
32 *length = strlen(mock->domains[domain_id]->name); in get_domain_name()
35 strncpy(buf, mock->domains[domain_id]->name, *length); in get_domain_name()
44 struct mock_log_link *mock = (struct mock_log_link *)link->ctx; in get_source_name() local
46 strncpy(buf, mock->domains[domain_id]->sources[source_id].source, in get_source_name()
48 *length = strlen(mock->domains[domain_id]->sources[source_id].source); in get_source_name()
[all …]
/Zephyr-latest/scripts/tests/twister_blackbox/
Dtest_hardwaremap.py9 import mock
19 @mock.patch.object(TestPlan, 'TESTSUITE_FILENAME', testsuite_filename_mock)
121 mock.Mock(device='/dev/ttyUSB23',
131 with mock.patch.object(sys, 'argv', [sys.argv[0]] + args), \
132 mock.patch('serial.tools.list_ports.comports',
173 mock.Mock(device='/dev/ttyUSB23',
178 mock.Mock(device='/dev/ttyUSB24',
183 mock.Mock(device='/dev/ttyUSB24',
188 mock.Mock(device='/dev/ttyUSB25',
195 with mock.patch.object(sys, 'argv', [sys.argv[0]] + args), \
[all …]
Dtest_tooling.py11 import mock
39 @mock.patch.object(TestPlan, 'TESTSUITE_FILENAME', testsuite_filename_mock)
49 with mock.patch.object(sys, 'argv', [sys.argv[0]] + args), \
59 @mock.patch.object(TestPlan, 'SAMPLE_FILENAME', sample_filename_mock)
71 with mock.patch.object(sys, 'argv', [sys.argv[0]] + args), \
105 @mock.patch.object(TestPlan, 'TESTSUITE_FILENAME', testsuite_filename_mock)
112 with mock.patch.object(sys, 'argv', [sys.argv[0]] + args), \
/Zephyr-latest/tests/subsys/logging/log_syst/
DKconfig5 bool "MOCK backend"
7 When enabled MOCK backend is used for logging. It is
13 backend = MOCK
14 backend-str = mock
/Zephyr-latest/tests/subsys/logging/log_switch_format/
DKconfig5 bool "MOCK backend"
8 When enabled MOCK backend is used for logging. It is
14 backend = MOCK
15 backend-str = mock
/Zephyr-latest/scripts/pylib/pytest-twister-harness/tests/device/
Dhardware_adapter_test.py8 from unittest import mock
32 @mock.patch('shutil.which', return_value=None)
38 @mock.patch('shutil.which', return_value='west')
46 @mock.patch('shutil.which', return_value='west')
57 @mock.patch('shutil.which', return_value='west')
68 @mock.patch('shutil.which', return_value='west')
81 @mock.patch('shutil.which', return_value='west')
94 @mock.patch('shutil.which', return_value='west')
106 @mock.patch('shutil.which', return_value='west')
118 @mock.patch('shutil.which', return_value='west')
[all …]
/Zephyr-latest/scripts/pylib/pytest-twister-harness/tests/fixtures/
Dmcumgr_fixture_test.py6 from unittest import mock
17 @mock.patch('twister_harness.helpers.mcumgr.MCUmgr.run_command', return_value='')
19 patched_run_command: mock.Mock, mcumgr: MCUmgr argument
50 mcumgr.run_command = mock.Mock(return_value=cmd_output)
70 mcumgr.run_command = mock.Mock(return_value=cmd_output)
/Zephyr-latest/samples/subsys/zbus/remote_mock/
DREADME.rst1 .. zephyr:code-sample:: zbus-remote-mock
2 :name: Remote mock sample
37 D: [Mock Proxy] Started.
38 D: [Mock Proxy RX] Started.
39 D: [Mock Proxy RX] Found sentence
72 From the remote mock (Python script), you would see something like this:
99 Exit the remote mock script by pressing :kbd:`CTRL+C`.

123456