Home
last modified time | relevance | path

Searched refs:mock (Results 1 – 25 of 263) sorted by relevance

1234567891011

/tools/acloud/internal/lib/
Dgcompute_client_test.py23 import mock
77 fake_cfg = mock.MagicMock()
81 fake_cfg, mock.MagicMock())
82 self.compute_client._service = mock.MagicMock()
99 resource_mock = mock.MagicMock()
100 mock_api = mock.MagicMock()
102 self.compute_client._service.globalOperations = mock.MagicMock(
105 self.compute_client._service.zoneOperations = mock.MagicMock(
108 self.compute_client._service.regionOperations = mock.MagicMock(
110 resource_mock.get = mock.MagicMock(return_value=mock_api)
[all …]
/tools/asuite/aidegen/lib/
Dmodule_info_util_unittest.py23 from unittest import mock
79 @mock.patch.object(os.path, 'getmtime')
80 @mock.patch.object(logging, 'info')
81 @mock.patch.object(os.path, 'isfile')
82 @mock.patch.object(module_info_util, '_get_generated_json_files')
90 mod_info = mock.MagicMock()
97 @mock.patch.object(module_info_util, '_generate_rust_project_link')
98 @mock.patch.object(module_info_util, '_show_build_failed_message')
99 @mock.patch.object(module_info_util, '_show_files_reuse_message')
100 @mock.patch.object(atest_utils, 'build')
[all …]
Dide_util_unittest.py26 from unittest import mock
104 @mock.patch.object(ide_util, '_get_linux_ide')
105 @mock.patch.object(ide_util, '_get_mac_ide')
113 @mock.patch.object(ide_util.IdeBase, '_get_user_preference')
114 @mock.patch.object(config.AidegenConfig, 'set_preferred_version')
115 @mock.patch.object(ide_util.IdeEclipse, '_get_script_from_system')
116 @mock.patch.object(ide_util.IdeIntelliJ, '_get_preferred_version')
141 @mock.patch.object(ide_util.IdeIntelliJ, '_set_installed_path')
142 @mock.patch.object(ide_common_util, 'get_script_from_input_path')
143 @mock.patch.object(ide_util.IdeIntelliJ, '_get_script_from_system')
[all …]
Dconfig_unittest.py23 from unittest import mock
56 @mock.patch('json.load')
57 @mock.patch('builtins.open')
58 @mock.patch('os.path.exists')
73 @mock.patch('logging.info')
74 @mock.patch('logging.error')
75 @mock.patch('builtins.open')
76 @mock.patch('os.path.exists')
92 @mock.patch('json.dump')
93 @mock.patch('builtins.open')
[all …]
Dproject_info_unittest.py24 from unittest import mock
97 self.args = mock.MagicMock()
111 @mock.patch('atest.module_info.ModuleInfo')
122 @mock.patch.object(project_info.ProjectInfo,
124 @mock.patch.object(project_info.ProjectInfo, 'get_dep_modules')
131 @mock.patch.object(common_util, 'get_android_root_dir')
146 @mock.patch('logging.info')
147 @mock.patch.object(common_util, 'get_android_root_dir')
148 @mock.patch('atest.module_info.ModuleInfo')
149 @mock.patch('atest.atest_utils.build')
[all …]
Dnative_module_info_unittest.py22 from unittest import mock
107 @mock.patch.object(
109 @mock.patch.object(common_util, 'get_related_paths')
118 @mock.patch.object(
127 @mock.patch.object(
136 @mock.patch.object(logging, 'warning')
137 @mock.patch.object(
146 @mock.patch.object(logging, 'warning')
147 @mock.patch.object(
156 @mock.patch.object(native_module_info.NativeModuleInfo,
[all …]
Dclion_project_file_gen_unittest.py22 from unittest import mock
55 @mock.patch('os.path.exists')
64 @mock.patch('os.path.exists')
73 @mock.patch.object(os, 'makedirs')
74 @mock.patch.object(os.path, 'exists')
75 @mock.patch.object(clion_project_file_gen.CLionProjectFileGenerator,
77 @mock.patch.object(clion_project_file_gen.CLionProjectFileGenerator,
94 @mock.patch('os.path.exists')
116 @mock.patch('os.path.exists')
137 @mock.patch('os.path.exists')
[all …]
Dcommon_util_unittest.py22 from unittest import mock
53 @mock.patch('os.getcwd')
54 @mock.patch('os.path.isabs')
55 @mock.patch.object(common_util, 'get_android_root_dir')
58 mod_info = mock.MagicMock()
94 @mock.patch('os.getcwd')
95 @mock.patch.object(common_util, 'is_android_root')
96 @mock.patch.object(common_util, 'get_android_root_dir')
102 mod_info = mock.MagicMock()
136 @mock.patch.object(common_util, 'is_android_root')
[all …]
/tools/test/connectivity/acts/framework/tests/
Dacts_android_device_test.py18 import mock
54 ad = mock.MagicMock(name="AndroidDevice", serial=i, h_port=None)
55 ad.ensure_screen_on = mock.MagicMock(return_value=True)
174 @mock.patch.object(
176 @mock.patch.object(
232 ads[0].start_services = mock.MagicMock()
233 ads[0].clean_up = mock.MagicMock()
234 ads[1].start_services = mock.MagicMock()
235 ads[1].clean_up = mock.MagicMock()
236 ads[2].start_services = mock.MagicMock(
[all …]
/tools/asuite/atest/test_runners/
Datest_tf_test_runner_unittest.py28 from unittest import mock
182 @mock.patch.object(atf_tr.AtestTradefedTestRunner, '_get_ld_library_path')
183 @mock.patch.dict('os.environ', {constants.ANDROID_BUILD_TOP:'/'})
189 mock.patch.stopall()
191 @mock.patch.object(atf_tr.AtestTradefedTestRunner,
193 @mock.patch.object(atf_tr.AtestTradefedTestRunner,
195 @mock.patch.object(atf_tr.AtestTradefedTestRunner,
197 @mock.patch.object(atf_tr.AtestTradefedTestRunner,
199 @mock.patch.object(atf_tr.AtestTradefedTestRunner,
201 @mock.patch('select.select')
[all …]
/tools/tradefederation/core/atest/test_runners/
Datest_tf_test_runner_unittest.py24 import mock
183 mock.patch.stopall()
185 @mock.patch.object(atf_tr.AtestTradefedTestRunner,
187 @mock.patch.object(atf_tr.AtestTradefedTestRunner,
189 @mock.patch.object(atf_tr.AtestTradefedTestRunner,
191 @mock.patch.object(atf_tr.AtestTradefedTestRunner,
193 @mock.patch.object(atf_tr.AtestTradefedTestRunner,
195 @mock.patch('select.select')
196 @mock.patch('os.killpg', return_value=None)
197 @mock.patch('os.getpgid', return_value=None)
[all …]
/tools/test/connectivity/acts/framework/tests/controllers/monsoon_lib/sampling/engine/
Dassembly_line_test.py19 import mock
32 return mock.patch('%s.%s' % (full_module_name, import_name))
38 @mock.patch('multiprocessing.Pool')
48 @mock.patch('multiprocessing.Pool')
51 node_list = [mock.Mock(), mock.Mock()]
79 node_list = [mock.Mock(), mock.Mock()]
96 builder = AssemblyLineBuilder(mock.Mock(), mock.Mock())
97 first_source = mock.Mock()
98 second_source = mock.Mock()
108 builder = AssemblyLineBuilder(mock.Mock(), mock.Mock())
[all …]
/tools/asuite/aidegen/
Daidegen_main_unittest.py24 from unittest import mock
91 @mock.patch.object(project_config.ProjectConfig, 'init_environment')
92 @mock.patch.object(project_config, 'ProjectConfig')
93 @mock.patch.object(project_file_gen.ProjectFileGenerator,
95 @mock.patch.object(eclipse_project_file_gen.EclipseConf,
114 @mock.patch.object(aidegen_main, 'main_with_message')
115 @mock.patch.object(aidegen_main, 'main_without_message')
123 @mock.patch.object(aidegen_metrics, 'starts_asuite_metrics')
124 @mock.patch.object(project_config, 'is_whole_android_tree')
125 @mock.patch.object(aidegen_metrics, 'ends_asuite_metrics')
[all …]
/tools/test/connectivity/acts/framework/tests/controllers/
Diperf_server_test.py19 import mock
57 @mock.patch('acts.controllers.iperf_server.utils')
93 @mock.patch('os.makedirs')
121 @mock.patch('builtins.open')
122 @mock.patch('acts.controllers.iperf_server.subprocess')
123 @mock.patch('acts.controllers.iperf_server.job')
132 @mock.patch('builtins.open')
133 @mock.patch('acts.controllers.iperf_server.subprocess')
134 @mock.patch('acts.controllers.iperf_server.job')
145 @mock.patch('builtins.open')
[all …]
/tools/test/connectivity/acts/framework/tests/controllers/sl4a_lib/
Dsl4a_manager_test.py16 import mock
35 adb = mock.Mock()
46 adb = mock.Mock()
50 adb_same_serial = mock.Mock()
62 adb_1 = mock.Mock()
66 adb_2 = mock.Mock()
126 adb = mock.Mock()
128 session_1 = mock.Mock()
131 session_2 = mock.Mock()
134 session_3 = mock.Mock()
[all …]
Drpc_client_test.py18 import mock
36 session = mock.Mock()
39 lambda _: mock.Mock(),
40 lambda _: mock.Mock())
41 client._log = mock.Mock()
42 client._working_connections = [mock.Mock()]
53 session = mock.Mock()
56 lambda _: mock.Mock(),
57 lambda _: mock.Mock())
58 client._log = mock.Mock()
[all …]
Dsl4a_session_test.py17 import mock
21 from mock import patch
38 session = mock.Mock()
48 session = mock.Mock()
59 session = mock.Mock()
70 session = mock.Mock()
81 session = mock.Mock()
82 session._create_client_side_connection = mock.Mock()
83 with mock.patch('socket.socket') as socket:
87 socket_instance = mock.Mock()
[all …]
/tools/asuite/atest/test_finders/
Dmodule_finder_unittest.py25 from unittest import mock
102 self.mod_finder.module_info = mock.Mock(spec=module_info.ModuleInfo)
118 @mock.patch.object(module_finder.ModuleFinder, '_get_build_targets',
138 @mock.patch.object(test_finder_utils, 'has_method_in_file',
140 @mock.patch.object(module_finder.ModuleFinder, '_is_vts_module',
142 @mock.patch.object(module_finder.ModuleFinder, '_get_build_targets')
143 @mock.patch('subprocess.check_output', return_value=uc.FIND_ONE)
144 @mock.patch.object(test_finder_utils, 'get_fully_qualified_class_name',
146 @mock.patch('os.path.isfile', side_effect=unittest_utils.isfile_side_effect)
147 @mock.patch('os.path.isdir', return_value=True)
[all …]
Dtest_finder_utils_unittest.py24 from unittest import mock
123 @mock.patch.object(test_finder_utils, 'has_method_in_file',
125 @mock.patch('builtins.input', return_value='0')
160 @mock.patch('builtins.input', return_value='1')
180 @mock.patch('builtins.input', return_value='1')
212 @mock.patch('os.path.isdir')
225 @mock.patch('os.path.isdir', return_value=True)
226 @mock.patch('os.path.isfile',
231 mock_module_info = mock.Mock(spec=module_info.ModuleInfo)
240 @mock.patch('os.path.isdir', return_value=True)
[all …]
/tools/tradefederation/core/atest/test_finders/
Dmodule_finder_unittest.py22 import mock
99 self.mod_finder.module_info = mock.Mock(spec=module_info.ModuleInfo)
115 @mock.patch.object(module_finder.ModuleFinder, '_get_build_targets',
135 @mock.patch.object(test_finder_utils, 'has_method_in_file',
137 @mock.patch.object(module_finder.ModuleFinder, '_is_vts_module',
139 @mock.patch.object(module_finder.ModuleFinder, '_get_build_targets')
140 @mock.patch('subprocess.check_output', return_value=uc.FIND_ONE)
141 @mock.patch.object(test_finder_utils, 'get_fully_qualified_class_name',
143 @mock.patch('os.path.isfile', side_effect=unittest_utils.isfile_side_effect)
144 @mock.patch('os.path.isdir', return_value=True)
[all …]
Dtest_finder_utils_unittest.py21 import mock
120 @mock.patch.object(test_finder_utils, 'has_method_in_file',
122 @mock.patch('__builtin__.raw_input', return_value='1')
157 @mock.patch('__builtin__.raw_input', return_value='1')
177 @mock.patch('__builtin__.raw_input', return_value='1')
209 @mock.patch('os.path.isdir')
222 @mock.patch('os.path.isdir', return_value=True)
223 @mock.patch('os.path.isfile',
228 mock_module_info = mock.Mock(spec=module_info.ModuleInfo)
237 @mock.patch('os.path.isdir', return_value=True)
[all …]
/tools/acloud/public/actions/
Dremote_instance_cf_device_factory_test.py24 import mock
45 self.Patch(auth, "CreateCredentials", return_value=mock.MagicMock())
48 self.Patch(list_instances, "GetInstancesFromInstanceNames", return_value=mock.MagicMock())
49 self.Patch(list_instances, "ChooseOneRemoteInstance", return_value=mock.MagicMock())
55 @mock.patch.object(remote_instance_cf_device_factory.RemoteInstanceDeviceFactory,
57 @mock.patch.object(remote_instance_cf_device_factory.RemoteInstanceDeviceFactory,
62 args = mock.MagicMock()
96 @mock.patch.dict(os.environ, {constants.ENV_BUILD_TARGET:'fake-target'})
100 args = mock.MagicMock()
110 fake_uuid = mock.MagicMock(hex="1234")
[all …]
/tools/test/connectivity/acts/framework/tests/controllers/rohdeschwarz_lib/
Dcontest_test.py19 from unittest import mock
25 sys.modules['zeep'] = mock.Mock()
44 with mock.patch('zeep.client.Client') as zeep_client:
47 zeep_client.return_value = mock.MagicMock()
77 dut_on_func = mock.Mock()
79 mock.Mock(), dut_on_func, mock.Mock())
80 protocol.send_ok = mock.Mock()
89 dut_off_func = mock.Mock()
91 mock.Mock(), mock.Mock(), dut_off_func)
92 protocol.send_ok = mock.Mock()
[all …]
/tools/acloud/setup/
Dgcp_setup_runner_test.py20 import mock
87 with mock.patch("os.path.isfile") as chkfile:
95 @mock.patch("os.path.dirname", return_value="")
96 @mock.patch.object(utils, "CheckOutput")
107 @mock.patch.object(six.moves, "input")
117 @mock.patch.object(gcp_setup_runner, "UpdateConfigFile")
118 @mock.patch.object(utils, "CreateSshKeyPairIfNotExist")
127 with mock.patch('os.path.expanduser') as ssh_path:
137 mock.call(self.cfg_path, "ssh_private_key_path",
139 mock.call(self.cfg_path, "ssh_public_key_path",
[all …]
/tools/test/connectivity/acts/framework/tests/libs/proc/
Dprocess_test.py18 import mock
54 return mock.patch('acts.libs.proc.process.%s' % imported_name,
61 callback = mock.Mock()
72 callback = mock.Mock()
92 process._process = mock.Mock()
107 process._process = mock.Mock()
121 process._process = mock.Mock()
128 @mock.patch.object(Process, '_kill_process')
133 process._process = mock.Mock()
140 @mock.patch.object(Process, '_kill_process')
[all …]

1234567891011