Home
last modified time | relevance | path

Searched refs:MagicMock (Results 1 – 25 of 100) sorted by relevance

1234

/external/python/cpython3/Lib/unittest/test/testmock/
Dtestmagicmethods.py5 from unittest.mock import AsyncMock, Mock, MagicMock, _magics
23 mock = MagicMock()
28 mock = MagicMock()
185 self.assertRaises(TypeError, lambda: MagicMock() < object())
186 self.assertRaises(TypeError, lambda: object() < MagicMock())
187 self.assertRaises(TypeError, lambda: MagicMock() < MagicMock())
188 self.assertRaises(TypeError, lambda: MagicMock() > object())
189 self.assertRaises(TypeError, lambda: object() > MagicMock())
190 self.assertRaises(TypeError, lambda: MagicMock() > MagicMock())
191 self.assertRaises(TypeError, lambda: MagicMock() <= object())
[all …]
Dtestasync.py10 from unittest.mock import (ANY, call, AsyncMock, patch, MagicMock, Mock,
189 self.assertIsInstance(mock_method, MagicMock)
193 self.assertIsInstance(mock_method.normal_method, MagicMock)
273 self.assertIsInstance(mock.normal_method, MagicMock)
275 for mock_type in [AsyncMock, MagicMock]:
294 for mock_type in [AsyncMock, MagicMock, Mock]:
308 for mock_type in [AsyncMock, MagicMock, Mock]:
336 self.assertIsInstance(mock_method, MagicMock)
344 self.assertIsInstance(mock_method, MagicMock)
360 self.assertIsInstance(MockNormalClass, MagicMock)
[all …]
Dtestmock.py12 MagicMock, Mock, NonCallableMock,
317 mm = mock.MagicMock()
320 self.assertFalse(mm == mock.MagicMock())
321 self.assertTrue(mm != mock.MagicMock())
329 call1 = mock.call(mock.MagicMock())
358 m = MagicMock()
359 m(MagicMock())
723 wrapped_dict = MagicMock(wraps=data)
726 self.assertIsInstance(wrapped_dict['foo'], MagicMock)
739 self.assertIsInstance(wrapped_dict['baz'], MagicMock)
[all …]
Dtestcallable.py9 Mock, MagicMock, NonCallableMagicMock,
31 self.assertTrue(issubclass(MagicMock, Mock))
40 self.assertTrue(issubclass(type(two.two), MagicMock))
50 class MagicSub(MagicMock):
115 self.assertTrue(is_instance(instance, MagicMock))
/external/python/mock/mock/tests/
Dtestmagicmethods.py22 from mock import Mock, MagicMock
41 mock = MagicMock()
46 mock = MagicMock()
227 self.assertRaises(TypeError, lambda: MagicMock() < object())
228 self.assertRaises(TypeError, lambda: object() < MagicMock())
229 self.assertRaises(TypeError, lambda: MagicMock() < MagicMock())
230 self.assertRaises(TypeError, lambda: MagicMock() > object())
231 self.assertRaises(TypeError, lambda: object() > MagicMock())
232 self.assertRaises(TypeError, lambda: MagicMock() > MagicMock())
233 self.assertRaises(TypeError, lambda: MagicMock() <= object())
[all …]
Dtestmock.py17 MagicMock, Mock, NonCallableMock,
53 class Subclass(MagicMock):
335 mm = mock.MagicMock()
338 self.assertFalse(mm == mock.MagicMock())
339 self.assertTrue(mm != mock.MagicMock())
345 call1 = mock.call(mock.MagicMock())
369 m = MagicMock()
370 m(MagicMock())
969 mock = MagicMock(foo='bar')
973 'foo': MagicMock()}
[all …]
Dtestcallable.py9 Mock, MagicMock, NonCallableMagicMock,
31 self.assertTrue(issubclass(MagicMock, Mock))
40 self.assertTrue(issubclass(type(two.two), MagicMock))
50 class MagicSub(MagicMock):
121 self.assertTrue(is_instance(instance, MagicMock))
/external/chromium-trace/catapult/dependency_manager/dependency_manager/
Ddependency_manager_unittest.py45 base_config_mock = mock.MagicMock(spec=dependency_manager.BaseConfig)
52 base_config_mock = mock.MagicMock(spec=dependency_manager.BaseConfig)
53 dep_info = mock.MagicMock(spec=dependency_manager.DependencyInfo)
66 base_config_mock = mock.MagicMock(spec=dependency_manager.BaseConfig)
70 dep_info1 = mock.MagicMock(spec=dependency_manager.DependencyInfo)
73 dep_info2 = mock.MagicMock(spec=dependency_manager.DependencyInfo)
87 base_config_mock = mock.MagicMock(spec=dependency_manager.BaseConfig)
92 dep_info1 = mock.MagicMock(spec=dependency_manager.DependencyInfo)
95 dep_info2 = mock.MagicMock(spec=dependency_manager.DependencyInfo)
98 dep_info3 = mock.MagicMock(spec=dependency_manager.DependencyInfo)
[all …]
/external/python/oauth2client/tests/
Dtest_crypt.py83 verifier = mock.MagicMock()
84 verifier.verify = mock.MagicMock(name='verify', return_value=True)
86 Verifier.from_string = mock.MagicMock(name='from_string',
104 verifier = mock.MagicMock()
107 verifier.verify = mock.MagicMock(name='verify',
110 Verifier.from_string = mock.MagicMock(name='from_string',
133 verifier = mock.MagicMock()
134 verifier.verify = mock.MagicMock(name='verify', return_value=False)
136 Verifier.from_string = mock.MagicMock(name='from_string',
207 time.time = mock.MagicMock(name='time',
[all …]
/external/autotest/server/cros/faft/
Dfirmware_test_unittest.py19 self.test = mock.MagicMock()
20 self.test_good = mock.MagicMock()
21 self.test_good_better = mock.MagicMock()
22 self.test_host_mock = mock.MagicMock()
23 self.test_arg2_mock = mock.MagicMock()
164 self._client = mock.MagicMock()
193 mock.MagicMock(side_effect=error.AutotestError("download")))
201 self.test.assert_test_image_in_usb_disk = mock.MagicMock()
202 self.test.set_servo_v4_role_to_snk = mock.MagicMock()
212 self.test.assert_test_image_in_usb_disk = mock.MagicMock()
[all …]
/external/autotest/server/cros/
Dprovisioner_unittest.py133 provisioner.dev_server = mock.MagicMock()
134 provisioner.metrics = mock.MagicMock()
135 host = mock.MagicMock()
138 cros_provisioner.check_update_status = mock.MagicMock()
139 kernel_utils.verify_kernel_state_after_update = mock.MagicMock()
141 kernel_utils.verify_boot_expectations = mock.MagicMock()
/external/tensorflow/tensorflow/python/debug/cli/
Dprofile_analyzer_cli_test.py102 graph = test.mock.MagicMock()
103 op1 = test.mock.MagicMock()
107 op2 = test.mock.MagicMock()
136 graph = test.mock.MagicMock()
137 op = test.mock.MagicMock()
199 graph = test.mock.MagicMock()
200 op1 = test.mock.MagicMock()
204 op2 = test.mock.MagicMock()
251 graph = test.mock.MagicMock()
252 op1 = test.mock.MagicMock()
[all …]
Devaluator_test.py148 dump = test.mock.MagicMock()
162 dump = test.mock.MagicMock()
179 dump = test.mock.MagicMock()
192 dump = test.mock.MagicMock()
218 dump = test.mock.MagicMock()
234 dump = test.mock.MagicMock()
247 dump = test.mock.MagicMock()
253 dump = test.mock.MagicMock()
/external/python/oauth2client/tests/contrib/
Dtest_gce.py71 http_request = mock.MagicMock()
72 http_mock = mock.MagicMock(request=http_request)
118 http_request = mock.MagicMock()
119 http_mock = mock.MagicMock(request=http_request)
134 http_request = mock.MagicMock()
135 http_mock = mock.MagicMock(request=http_request)
Dtest_xsrfutil.py52 digester = mock.MagicMock()
53 digester.digest = mock.MagicMock(name='digest', return_value=digest)
55 hmac.new = mock.MagicMock(name='new', return_value=digester)
81 digester = mock.MagicMock()
82 digester.digest = mock.MagicMock(name='digest', return_value=digest)
84 hmac.new = mock.MagicMock(name='new', return_value=digester)
87 time.time = mock.MagicMock(name='time', return_value=curr_time)
145 time.time = mock.MagicMock(name='time', return_value=curr_time)
Dtest_keyring_storage.py61 mock_return_creds = mock.MagicMock()
62 mock_return_creds.set_store = set_store = mock.MagicMock(
69 MockCreds.new_from_json = new_from_json = mock.MagicMock(
85 credentials = mock.MagicMock()
87 credentials.to_json = to_json = mock.MagicMock(
/external/autotest/client/common_lib/cros/fake_device_server/
Dregistration_tickets_unittest.py67 common_util.parse_serialized_json = mock.MagicMock(
69 common_util.grab_header_field = mock.MagicMock(
94 common_util.parse_serialized_json = mock.MagicMock(
107 common_util.parse_serialized_json = mock.MagicMock(
118 common_util.parse_serialized_json = mock.MagicMock(
Dresource_method_unittest.py35 common_util.parse_serialized_json = mock.MagicMock(
48 common_util.parse_serialized_json = mock.MagicMock(
59 common_util.parse_serialized_json = mock.MagicMock(
/external/tensorflow/tensorflow/python/profiler/
Dpprof_profiler_test.py39 graph = test.mock.MagicMock()
51 graph = test.mock.MagicMock()
52 op1 = test.mock.MagicMock()
79 graph = test.mock.MagicMock()
80 op1 = test.mock.MagicMock()
/external/chromium-trace/catapult/devil/devil/android/tools/
Ddevice_monitor_test.py48 self.device.ReadFile = mock.MagicMock(
64 self.device.RunShellCommand = mock.MagicMock(side_effect=mock_run_shell)
67 self.battery.GetBatteryInfo = mock.MagicMock(return_value={
111 broken_battery_info.GetBatteryInfo = mock.MagicMock(return_value={
160 denylist.Read = mock.MagicMock(
/external/autotest/server/cros/cfm/configurable_test/
Dconfigurable_cfm_test_unittest.py3 from mock import MagicMock
23 cfm_facade_mock = MagicMock(
40 cfm_facade_mock = MagicMock(
Dactions_unittest.py25 self.host_mock = mock.MagicMock()
26 self.cfm_facade_mock = mock.MagicMock()
27 self.usb_device_collector_mock = mock.MagicMock()
28 self.usb_port_manager_mock = mock.MagicMock()
29 self.crash_detector_mock = mock.MagicMock()
30 self.metrics_collector_mock = mock.MagicMock()
/external/chromium-trace/catapult/devil/devil/utils/
Dcmd_helper_test.py114 self.mock_proc = mock.MagicMock(spec=subprocess.Popen)
115 self.mock_proc.stdout = mock.MagicMock()
116 self.mock_proc.stdout.fileno = mock.MagicMock(
177 mock_read = mock.MagicMock(side_effect=read_side_effect)
178 mock_select = mock.MagicMock(side_effect=select_side_effect)
179 mock_time = mock.MagicMock(side_effect=time_side_effect)
180 self.mock_proc.poll = mock.MagicMock(side_effect=poll_side_effect)
/external/tensorflow/tensorflow/python/distribute/cluster_resolver/
Dgce_cluster_resolver_test.py49 mock_instance_group_request = mock.MagicMock()
67 mock_get_request = mock.MagicMock()
78 mock_get_request = mock.MagicMock()
91 mock_instances = mock.MagicMock(**service_attrs)
104 mock_client = mock.MagicMock()
/external/python/oauth2client/tests/contrib/django_util/
Dtest_decorators.py66 request.session = mock.MagicMock()
91 request.session = mock.MagicMock()
144 request.session = mock.MagicMock()
150 my_user_oauth = mock.MagicMock()
164 request.session = mock.MagicMock()
182 request.session = mock.MagicMock()

1234