Index: build/android/devil/android/device_utils_test.py |
diff --git a/build/android/devil/android/device_utils_test.py b/build/android/devil/android/device_utils_test.py |
index de9df4e9c9dea227343db66f3308a1e6a2da0f24..5eb0525e42d7c2e81b7b6975726a28e5c6ef849c 100755 |
--- a/build/android/devil/android/device_utils_test.py |
+++ b/build/android/devil/android/device_utils_test.py |
@@ -11,10 +11,10 @@ |
# pylint: disable=unused-argument |
import logging |
+import os |
import sys |
import unittest |
-from devil import devil_env |
from devil.android import device_errors |
from devil.android import device_signal |
from devil.android import device_utils |
@@ -23,8 +23,10 @@ |
from devil.android.sdk import version_codes |
from devil.utils import cmd_helper |
from devil.utils import mock_calls |
- |
-sys.path.append(devil_env.config.pymock_path) |
+from pylib import constants |
+ |
+sys.path.append(os.path.join( |
+ constants.DIR_SOURCE_ROOT, 'third_party', 'pymock')) |
import mock # pylint: disable=F0401 |
@@ -56,21 +58,17 @@ |
class DeviceUtilsGetAVDsTest(mock_calls.TestCase): |
def testGetAVDs(self): |
- mocked_attrs = { |
- 'android_sdk_path': '/my/sdk/path' |
- } |
- with mock.patch('devil.devil_env._Environment.__getattr__', |
- mock.Mock(side_effect=lambda a: mocked_attrs[a])): |
- with self.assertCall( |
- mock.call.devil.utils.cmd_helper.GetCmdOutput( |
- [mock.ANY, 'list', 'avd']), |
- 'Available Android Virtual Devices:\n' |
- ' Name: my_android5.0\n' |
- ' Path: /some/path/to/.android/avd/my_android5.0.avd\n' |
- ' Target: Android 5.0 (API level 21)\n' |
- ' Tag/ABI: default/x86\n' |
- ' Skin: WVGA800\n'): |
- self.assertEquals(['my_android5.0'], device_utils.GetAVDs()) |
+ with self.assertCall( |
+ mock.call.devil.utils.cmd_helper.GetCmdOutput( |
+ [mock.ANY, 'list', 'avd']), |
+ 'Available Android Virtual Devices:\n' |
+ ' Name: my_android5.0\n' |
+ ' Path: /some/path/to/.android/avd/my_android5.0.avd\n' |
+ ' Target: Android 5.0 (API level 21)\n' |
+ ' Tag/ABI: default/x86\n' |
+ ' Skin: WVGA800\n'): |
+ self.assertEquals(['my_android5.0'], |
+ device_utils.GetAVDs()) |
class DeviceUtilsRestartServerTest(mock_calls.TestCase): |