Lines Matching refs:list_instance
28 from acloud.list import list as list_instance unknown
65 self.Patch(list_instance, "GetLocalInstancesByNames",
67 self.Patch(list_instance, "GetRemoteInstances",
69 instances_list = list_instance.GetInstancesFromInstanceNames(cfg, instance_names)
74 instances_list = list_instance.GetInstancesFromInstanceNames(cfg, instance_names)
84 list_instance.GetInstancesFromInstanceNames,
94 self.Patch(list_instance, "GetCFRemoteInstances", return_value=instance_names)
96 self.assertEqual(list_instance.ChooseOneRemoteInstance(cfg), expected_instance)
99 self.Patch(list_instance, "GetCFRemoteInstances", return_value=[])
101 list_instance.ChooseOneRemoteInstance(cfg)
106 self.Patch(list_instance, "GetCFRemoteInstances", return_value=instance_names)
109 self.assertEqual(list_instance.ChooseOneRemoteInstance(cfg), expected_instance)
122 mock_get_cf = self.Patch(list_instance,
130 ins_list = list_instance.GetLocalInstancesByNames([
145 list_instance.FilterInstancesByAdbPort(expected_instance, 1111))
148 list_instance.FilterInstancesByAdbPort(expected_instance, 2222)
155 mock_isfile = self.Patch(list_instance.os.path, "isfile",
166 ins_list = list_instance._GetLocalCuttlefishInstances(id_cfg_pairs)
177 ins_list = list_instance._GetLocalCuttlefishInstances(id_cfg_pairs)
186 ins_list = list_instance._GetLocalCuttlefishInstances(id_cfg_pairs)
209 list_instance.PrintInstancesDetails([ins], verbose=True)
214 list_instance.PrintInstancesDetails([ins], verbose=False)
218 list_instance.PrintInstancesDetails([], verbose=True)
230 self.Patch(list_instance, "PrintInstancesDetails")
235 self.Patch(list_instance, "_GetLocalCuttlefishInstances",
239 list_instance.Run(args)
240 list_instance.PrintInstancesDetails.assert_called_with(
247 self.Patch(list_instance, "GetRemoteInstances",
249 list_instance.Run(args)
250 list_instance.PrintInstancesDetails.assert_called_with(
264 self.assertEqual(list_instance.GetRemoteInstances(None)[0].name,
266 self.assertEqual(len(list_instance.GetRemoteInstances(None)), 2)
280 self.Patch(list_instance, "GetRemoteInstances",
282 self.assertEqual(len(list_instance.GetCFRemoteInstances(None)), 1)
292 self.assertEqual(list_instance.GetActiveCVD(1), fake_local_ins)
297 self.assertEqual(list_instance.GetActiveCVD(1), None)
305 self.assertEqual(list_instance.GetActiveCVD(1), fake_local_ins)
306 self.assertEqual(list_instance.GetActiveCVD(2), None)
309 self.assertEqual(list_instance.GetActiveCVD(1), None)
314 self.assertEqual(list_instance.GetActiveCVD(1), None)
318 self.Patch(list_instance, "GetLocalInstances",
320 self.Patch(list_instance, "GetRemoteInstances",
322 self.assertEqual(len(list_instance.ChooseInstances(None, True)), 4)
326 self.assertEqual(list_instance.ChooseInstances(None), choose_instance)
328 list_instance.GetLocalInstances.return_value = []
329 list_instance.GetRemoteInstances.return_value = ["only_one_ins"]
330 self.assertEqual(list_instance.ChooseInstances(None), ["only_one_ins"])
337 list_instance.GetLocalInstanceLockByName("query_name")
344 list_instance.GetLocalInstanceLockByName("query_name")
350 list_instance.GetLocalInstanceLockByName("query_name"), None)