Lines Matching refs:mock

9 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()
169 mocked_hm.load = mock.Mock(side_effect=mock_load)
170 mocked_hm.dump = mock.Mock()
171 mocked_hm.add_device = mock.Mock()
181 mocked_hm.options.persistent_hardware_map = mock.Mock()
251 hm = HardwareMap(env=mock.Mock())
300 return mock.mock_open(read_data=map_file)(*args, **kwargs)
303 hm = HardwareMap(env=mock.Mock())
307 with mock.patch('builtins.open', mock_open):
406 mock.Mock(
413 mock.Mock(
420 mock.Mock(
427 mock.Mock(
434 mock.Mock(
443 with mock.patch('platform.system', return_value=system), \
444 mock.patch('serial.tools.list_ports.comports',
446 mock.patch('twisterlib.hardwaremap.Path.resolve',
448 mock.patch('twisterlib.hardwaremap.Path.iterdir',
450 mock.patch('twisterlib.hardwaremap.Path.exists',
468 'runner': mock.ANY,
476 'runner': mock.ANY,
484 'runner': mock.ANY,
492 'runner': mock.ANY,
500 'runner': mock.ANY,
515 'lock': mock.ANY,
524 'lock': mock.ANY,
534 'lock': mock.ANY,
543 'lock': mock.ANY,
553 'lock': mock.ANY,
615 'lock': mock.ANY,
624 'lock': mock.ANY,
634 'lock': mock.ANY,
644 'lock': mock.ANY,
657 read_mock = mock.mock_open(read_data=hwm)
658 write_mock = mock.mock_open()
667 mocked_hm.load = mock.Mock()
668 mocked_hm.dump = mock.Mock()
670 open_mock = mock.Mock(side_effect=mock_open)
671 dump_mock = mock.Mock()
673 with mock.patch('os.path.exists', return_value=hwm is not None), \
674 mock.patch('builtins.open', open_mock), \
675 mock.patch('twisterlib.hardwaremap.yaml.dump', dump_mock):
678 dump_mock.assert_called_once_with(expected_dump, mock.ANY, Dumper=mock.ANY,
679 default_flow_style=mock.ANY)