Home
last modified time | relevance | path

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

1234

/external/python/cpython3/Lib/unittest/test/testmock/
Dtestmagicmethods.py3 from unittest.mock import Mock, MagicMock, _magics
21 mock = MagicMock()
26 mock = MagicMock()
183 self.assertRaises(TypeError, lambda: MagicMock() < object())
184 self.assertRaises(TypeError, lambda: object() < MagicMock())
185 self.assertRaises(TypeError, lambda: MagicMock() < MagicMock())
186 self.assertRaises(TypeError, lambda: MagicMock() > object())
187 self.assertRaises(TypeError, lambda: object() > MagicMock())
188 self.assertRaises(TypeError, lambda: MagicMock() > MagicMock())
189 self.assertRaises(TypeError, lambda: MagicMock() <= object())
[all …]
Dtestmock.py10 MagicMock, Mock, NonCallableMock,
311 mm = mock.MagicMock()
314 self.assertFalse(mm == mock.MagicMock())
315 self.assertTrue(mm != mock.MagicMock())
321 call1 = mock.call(mock.MagicMock())
345 m = MagicMock()
346 m(MagicMock())
877 mock = MagicMock(foo='bar')
881 'foo': MagicMock()}
885 self.assertIsInstance(mock.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):
116 self.assertTrue(is_instance(instance, MagicMock))
/external/python/mock/mock/tests/
Dtestmagicmethods.py21 from mock import Mock, MagicMock
40 mock = MagicMock()
45 mock = MagicMock()
226 self.assertRaises(TypeError, lambda: MagicMock() < object())
227 self.assertRaises(TypeError, lambda: object() < MagicMock())
228 self.assertRaises(TypeError, lambda: MagicMock() < MagicMock())
229 self.assertRaises(TypeError, lambda: MagicMock() > object())
230 self.assertRaises(TypeError, lambda: object() > MagicMock())
231 self.assertRaises(TypeError, lambda: MagicMock() > MagicMock())
232 self.assertRaises(TypeError, lambda: MagicMock() <= object())
[all …]
Dtestmock.py16 MagicMock, Mock, NonCallableMock,
56 class Subclass(MagicMock):
789 mock = MagicMock(foo='bar')
793 'foo': MagicMock()}
797 self.assertIsInstance(mock.foo, MagicMock)
803 self.assertIsInstance(mock.foo, MagicMock)
876 mock = MagicMock()
882 mock = MagicMock()
893 mock = MagicMock()
904 mock = 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):
123 self.assertTrue(is_instance(instance, MagicMock))
Dtestpatch.py16 MagicMock, Mock, NonCallableMagicMock, patch,
224 self.assertIsInstance(mock, MagicMock,
240 self.assertIsInstance(mock2, MagicMock,
242 self.assertIsInstance(mock2, MagicMock,
261 self.assertTrue(is_instance(SomeClass.wibble, MagicMock))
272 MagicMock))
283 self.assertTrue(is_instance(SomeClass.wibble, MagicMock))
294 MagicMock))
307 self.assertTrue(is_instance(SomeClass.wibble, MagicMock))
339 self.assertTrue(is_instance(MockSomeClass, MagicMock))
[all …]
/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/client/common_lib/cros/
Dgs_cache_client_unittest.py45 m.return_value = mock.MagicMock(ok=True, content='{}')
54 m.return_value = mock.MagicMock(ok=True, content='{}')
68 m.side_effect = error.CmdError('cmd', mock.MagicMock(exit_status=1))
73 m.side_effect = error.CmdError('cmd', mock.MagicMock(
91 m.return_value = mock.MagicMock(ok=False)
96 m.return_value = mock.MagicMock(ok=True, content='...')
110 self.api = mock.MagicMock(server_netloc='api_netloc')
111 self.dev_server = mock.MagicMock()
154 self.client._list_suite_controls = mock.MagicMock(
/external/v8/tools/unittests/
Drun_perf_test.py9 from mock import MagicMock, patch
131 cmd = MagicMock()
134 cmd.execute = MagicMock(side_effect=execute)
137 command.Command = MagicMock(side_effect=create_cmd)
143 os.chdir = MagicMock(side_effect=chdir)
145 subprocess.check_call = MagicMock()
146 platform.system = MagicMock(return_value='Linux')
428 platform.PreExecution = MagicMock(return_value=None)
429 platform.PostExecution = MagicMock(return_value=None)
430 platform.PreTests = MagicMock(return_value=None)
[all …]
/external/autotest/scheduler/
Dscheduler_lib_unittest.py25 readonly_connection.set_globally_disabled = mock.MagicMock()
26 setup_django_environment.enable_autocommit = mock.MagicMock()
39 connection_manager.open_connection = mock.MagicMock()
49 connection_manager.disconnect = mock.MagicMock()
56 database_connection._DjangoBackend.execute = mock.MagicMock()
/external/autotest/server/cros/network/
Drf_switch_client_box_test.py16 rf_switch_client_box.frontend = mock.MagicMock()
25 rf_switch_client_box.frontend = mock.MagicMock()
41 rf_switch_client_box.frontend = mock.MagicMock()
51 rf_switch_client_box.frontend = mock.MagicMock()
65 rf_switch_client_box.frontend = 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/chromium-trace/catapult/devil/devil/utils/
Dcmd_helper_test.py111 self.mock_proc = mock.MagicMock(spec=subprocess.Popen)
112 self.mock_proc.stdout = mock.MagicMock()
113 self.mock_proc.stdout.fileno = mock.MagicMock(
175 mock_read = mock.MagicMock(side_effect=read_side_effect)
176 mock_select = mock.MagicMock(side_effect=select_side_effect)
177 mock_time = mock.MagicMock(side_effect=time_side_effect)
178 self.mock_proc.poll = mock.MagicMock(side_effect=poll_side_effect)
/external/chromium-trace/catapult/devil/devil/android/tools/
Ddevice_monitor_test.py40 self.device.ReadFile = mock.MagicMock(
56 self.device.RunShellCommand = mock.MagicMock(side_effect=mock_run_shell)
59 self.battery.GetBatteryInfo = mock.MagicMock(
101 broken_battery_info.GetBatteryInfo = mock.MagicMock(
148 blacklist.Read = 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/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/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