Lines Matching refs:host
65 host = MockHost(
68 self.assertEqual(host.get_platform(), 'coral')
71 host = MockHost(
75 self.assertEqual(host.get_platform(), 'coral')
78 host = MockHost(
83 self.assertEqual(host.get_platform(), 'reef')
86 host = MockHost(
89 self.assertEqual(host.get_platform(), 'reef')
92 host = MockHost(
95 self.assertEqual(host.get_platform(), 'reef')
127 host = MockHost()
128 host.servo = None
129 host._servo_host = mock.Mock()
132 host._servo_host.get_servo.return_value = servo
133 host._servo_host.get_servo_state.return_value = 'SOME_STATE'
134 host.host_info_store = host_info.InMemoryHostInfoStore()
135 return host
138 host = self.create_host()
139 host._servo_host = None
141 host.set_servo_state('some_status')
142 … self.assertEqual(host.host_info_store.get().get_label_value(SERVO_STATE_PREFIX), 'some_status')
145 host = self.create_host()
147 host.set_servo_state(None)
148 host._servo_host.get_servo_state.assert_not_called()
149 self.assertEqual(host.host_info_store.get().get_label_value(SERVO_STATE_PREFIX), '')
152 host = self.create_host()
153 host._servo_host.repair.side_effect = Exception('Something bad')
156 host.repair_servo()
160 host._servo_host.get_servo_state.assert_called()
161 … self.assertEqual(host.host_info_store.get().get_label_value(SERVO_STATE_PREFIX), 'SOME_STATE')
164 host = self.create_host()
166 host.repair_servo()
170 host._servo_host.get_servo_state.assert_called()
171 … self.assertEqual(host.host_info_store.get().get_label_value(SERVO_STATE_PREFIX), 'SOME_STATE')
174 host = self.create_host()
175 host._servo_host = mock.Mock()
178 host._servo_host.get_servo.return_value = servo
179 host._servo_host.get_servo_state.return_value = 'SOME_STATE'
180 self.assertEqual(host.host_info_store.get().get_label_value(SERVO_STATE_PREFIX), '')
183 host.repair_servo()
187 host._servo_host.get_servo_state.assert_called()
188 … self.assertEqual(host.host_info_store.get().get_label_value(SERVO_STATE_PREFIX), 'SOME_STATE')
191 host = self.create_host()
193 host.set_servo_host(None, 'passed_State')
194 … self.assertEqual(host.host_info_store.get().get_label_value(SERVO_STATE_PREFIX), 'passed_State')
197 host = self.create_host()
204 host.set_servo_host(servo_host)
205 … self.assertEqual(host.host_info_store.get().get_label_value(SERVO_STATE_PREFIX), 'state_of_host')
208 host.set_servo_host(servo_host, 'passed_State')
209 … self.assertEqual(host.host_info_store.get().get_label_value(SERVO_STATE_PREFIX), 'state_of_host2')
221 host = self.TestCrosHost()
226 host.stage_build_to_usb('board/version')
229 host.servo.image_to_servo_usb.assert_called_with('image_url')
231 host.servo.get_power_state_controller.return_value.power_on.assert_called()
235 host = self.TestCrosHost()
239 host.servo.image_to_servo_usb.side_effect = error.AutotestError('download')
242 host.stage_build_to_usb('board/version')
244 host.servo.get_power_state_controller.return_value.power_on.assert_called()