| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """Environment setup and teardown for remote devices.""" | 5 """Environment setup and teardown for remote devices.""" |
| 6 | 6 |
| 7 import distutils.version | 7 import distutils.version |
| 8 import json | 8 import json |
| 9 import logging | 9 import logging |
| 10 import os | 10 import os |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 def _GetDeviceList(self): | 295 def _GetDeviceList(self): |
| 296 with appurify_sanitized.SanitizeLogging(self._verbose_count, | 296 with appurify_sanitized.SanitizeLogging(self._verbose_count, |
| 297 logging.WARNING): | 297 logging.WARNING): |
| 298 dev_list_res = appurify_sanitized.api.devices_list(self._access_token) | 298 dev_list_res = appurify_sanitized.api.devices_list(self._access_token) |
| 299 remote_device_helper.TestHttpResponse(dev_list_res, | 299 remote_device_helper.TestHttpResponse(dev_list_res, |
| 300 'Unable to generate access token.') | 300 'Unable to generate access token.') |
| 301 return dev_list_res.json()['response'] | 301 return dev_list_res.json()['response'] |
| 302 | 302 |
| 303 def _NoDeviceFound(self): | 303 def _NoDeviceFound(self): |
| 304 self._PrintAvailableDevices(self._GetDeviceList()) | 304 self._PrintAvailableDevices(self._GetDeviceList()) |
| 305 raise remote_device_helper.RemoteDeviceError('No device found.') | 305 raise remote_device_helper.RemoteDeviceError( |
| 306 'No device found.', is_infra_error=True) |
| 306 | 307 |
| 307 @property | 308 @property |
| 308 def collect(self): | 309 def collect(self): |
| 309 return self._collect | 310 return self._collect |
| 310 | 311 |
| 311 @property | 312 @property |
| 312 def device_type_id(self): | 313 def device_type_id(self): |
| 313 return self._device['device_type_id'] | 314 return self._device['device_type_id'] |
| 314 | 315 |
| 315 @property | 316 @property |
| (...skipping 25 matching lines...) Expand all Loading... |
| 341 def trigger(self): | 342 def trigger(self): |
| 342 return self._trigger | 343 return self._trigger |
| 343 | 344 |
| 344 @property | 345 @property |
| 345 def verbose_count(self): | 346 def verbose_count(self): |
| 346 return self._verbose_count | 347 return self._verbose_count |
| 347 | 348 |
| 348 @property | 349 @property |
| 349 def device_type(self): | 350 def device_type(self): |
| 350 return self._device_type | 351 return self._device_type |
| OLD | NEW |