diff options
author | jbudorick <jbudorick@chromium.org> | 2015-12-10 22:09:50 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-12-11 06:11:32 +0000 |
commit | 460eb6084baecd767d6463d78363cadaa51a7953 (patch) | |
tree | c6a9f5bf6bd0252b8b668ea529783e6df554b31f /build | |
parent | 1dc262725270493bf333d53888319acacc5e8baa (diff) | |
download | chromium_src-460eb6084baecd767d6463d78363cadaa51a7953.zip chromium_src-460eb6084baecd767d6463d78363cadaa51a7953.tar.gz chromium_src-460eb6084baecd767d6463d78363cadaa51a7953.tar.bz2 |
[Android] Remove all references to pylib.constants from devil/.
BUG=560559
R=rnephew@chromium.org,mikecase@chromium.org
Review URL: https://codereview.chromium.org/1513123002
Cr-Commit-Position: refs/heads/master@{#364620}
Diffstat (limited to 'build')
-rw-r--r-- | build/android/devil/android/app_ui_test.py | 9 | ||||
-rwxr-xr-x | build/android/devil/android/battery_utils_test.py | 5 | ||||
-rw-r--r-- | build/android/devil/android/device_blacklist.py | 7 | ||||
-rwxr-xr-x | build/android/devil/android/device_utils_device_test.py | 3 | ||||
-rwxr-xr-x | build/android/devil/android/device_utils_test.py | 5 | ||||
-rwxr-xr-x | build/android/devil/android/fastboot_utils_test.py | 5 | ||||
-rwxr-xr-x | build/android/devil/android/logcat_monitor_test.py | 5 | ||||
-rwxr-xr-x | build/android/devil/android/md5sum_test.py | 5 | ||||
-rwxr-xr-x | build/android/devil/android/sdk/shared_prefs_test.py | 5 | ||||
-rw-r--r-- | build/android/devil/utils/mock_calls.py | 5 | ||||
-rwxr-xr-x | build/android/devil/utils/mock_calls_test.py | 5 |
11 files changed, 19 insertions, 40 deletions
diff --git a/build/android/devil/android/app_ui_test.py b/build/android/devil/android/app_ui_test.py index dd01814..22390a6 100644 --- a/build/android/devil/android/app_ui_test.py +++ b/build/android/devil/android/app_ui_test.py @@ -4,19 +4,16 @@ """Unit tests for the app_ui module.""" -import os -import sys import unittest from xml.etree import ElementTree as element_tree +from devil import devil_env from devil.android import app_ui from devil.android import device_errors from devil.utils import geometry -from pylib import constants -sys.path.append(os.path.join( - constants.DIR_SOURCE_ROOT, 'third_party', 'pymock')) -import mock # pylint: disable=import-error +with devil_env.SysPath(devil_env.config.LocalPath('pymock')): + import mock # pylint: disable=import-error MOCK_XML_LOADING = ''' diff --git a/build/android/devil/android/battery_utils_test.py b/build/android/devil/android/battery_utils_test.py index cf0a15f..f833e71 100755 --- a/build/android/devil/android/battery_utils_test.py +++ b/build/android/devil/android/battery_utils_test.py @@ -10,7 +10,6 @@ Unit tests for the contents of battery_utils.py # pylint: disable=protected-access,unused-argument import logging -import sys import unittest from devil import devil_env @@ -20,8 +19,8 @@ from devil.android import device_utils from devil.android import device_utils_test from devil.utils import mock_calls -sys.path.append(devil_env.config.LocalPath('pymock')) -import mock # pylint: disable=import-error +with devil_env.SysPath(devil_env.config.LocalPath('pymock')): + import mock # pylint: disable=import-error _DUMPSYS_OUTPUT = [ '9,0,i,uid,1000,test_package1', diff --git a/build/android/devil/android/device_blacklist.py b/build/android/devil/android/device_blacklist.py index a38da15..94f9cbe 100644 --- a/build/android/devil/android/device_blacklist.py +++ b/build/android/devil/android/device_blacklist.py @@ -8,13 +8,6 @@ import os import threading import time -from pylib import constants - -# TODO(jbudorick): Remove this once the blacklist is optional. -BLACKLIST_JSON = os.path.join( - constants.DIR_SOURCE_ROOT, - os.environ.get('CHROMIUM_OUT_DIR', 'out'), - 'bad_devices.json') class Blacklist(object): diff --git a/build/android/devil/android/device_utils_device_test.py b/build/android/devil/android/device_utils_device_test.py index 4334a0f..d4b823d 100755 --- a/build/android/devil/android/device_utils_device_test.py +++ b/build/android/devil/android/device_utils_device_test.py @@ -12,7 +12,6 @@ import os import tempfile import unittest -from pylib import constants from devil.android import device_utils from devil.android.sdk import adb_wrapper from devil.utils import cmd_helper @@ -33,8 +32,6 @@ class DeviceUtilsPushDeleteFilesTest(unittest.TestCase): self.adb.WaitForDevice() self.device = device_utils.DeviceUtils( self.adb, default_timeout=10, default_retries=0) - default_build_type = os.environ.get('BUILDTYPE', 'Debug') - constants.SetBuildType(default_build_type) @staticmethod def _MakeTempFile(contents): diff --git a/build/android/devil/android/device_utils_test.py b/build/android/devil/android/device_utils_test.py index c8c0952..eedd78c 100755 --- a/build/android/devil/android/device_utils_test.py +++ b/build/android/devil/android/device_utils_test.py @@ -11,7 +11,6 @@ Unit tests for the contents of device_utils.py (mostly DeviceUtils). # pylint: disable=unused-argument import logging -import sys import unittest from devil import devil_env @@ -24,8 +23,8 @@ 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.LocalPath('pymock')) -import mock # pylint: disable=import-error +with devil_env.SysPath(devil_env.config.LocalPath('pymock')): + import mock # pylint: disable=import-error class _MockApkHelper(object): diff --git a/build/android/devil/android/fastboot_utils_test.py b/build/android/devil/android/fastboot_utils_test.py index 67d5c64..b231d02 100755 --- a/build/android/devil/android/fastboot_utils_test.py +++ b/build/android/devil/android/fastboot_utils_test.py @@ -11,7 +11,6 @@ Unit tests for the contents of fastboot_utils.py import io import logging -import sys import unittest from devil import devil_env @@ -21,8 +20,8 @@ from devil.android import fastboot_utils from devil.android.sdk import fastboot from devil.utils import mock_calls -sys.path.append(devil_env.config.LocalPath('pymock')) -import mock # pylint: disable=import-error +with devil_env.SysPath(devil_env.config.LocalPath('pymock')): + import mock # pylint: disable=import-error _BOARD = 'board_type' _SERIAL = '0123456789abcdef' diff --git a/build/android/devil/android/logcat_monitor_test.py b/build/android/devil/android/logcat_monitor_test.py index 923c671..6198560 100755 --- a/build/android/devil/android/logcat_monitor_test.py +++ b/build/android/devil/android/logcat_monitor_test.py @@ -6,15 +6,14 @@ # pylint: disable=protected-access import itertools -import sys import unittest from devil import devil_env from devil.android import logcat_monitor from devil.android.sdk import adb_wrapper -sys.path.append(devil_env.config.LocalPath('pymock')) -import mock # pylint: disable=import-error +with devil_env.SysPath(devil_env.config.LocalPath('pymock')): + import mock # pylint: disable=import-error def _CreateTestLog(raw_logcat=None): diff --git a/build/android/devil/android/md5sum_test.py b/build/android/devil/android/md5sum_test.py index 86023f7..5001557 100755 --- a/build/android/devil/android/md5sum_test.py +++ b/build/android/devil/android/md5sum_test.py @@ -4,15 +4,14 @@ # found in the LICENSE file. import os -import sys import unittest from devil import devil_env from devil.android import device_errors from devil.android import md5sum -sys.path.append(devil_env.config.LocalPath('pymock')) -import mock # pylint: disable=import-error +with devil_env.SysPath(devil_env.config.LocalPath('pymock')): + import mock # pylint: disable=import-error TEST_OUT_DIR = os.path.join('test', 'out', 'directory') HOST_MD5_EXECUTABLE = os.path.join(TEST_OUT_DIR, 'md5sum_bin_host') diff --git a/build/android/devil/android/sdk/shared_prefs_test.py b/build/android/devil/android/sdk/shared_prefs_test.py index 6eba2295..15a348a 100755 --- a/build/android/devil/android/sdk/shared_prefs_test.py +++ b/build/android/devil/android/sdk/shared_prefs_test.py @@ -8,15 +8,14 @@ Unit tests for the contents of shared_prefs.py (mostly SharedPrefs). """ import logging -import sys import unittest from devil import devil_env from devil.android import device_utils from devil.android.sdk import shared_prefs -sys.path.append(devil_env.config.LocalPath('pymock')) -import mock # pylint: disable=import-error +with devil_env.SysPath(devil_env.config.LocalPath('pymock')): + import mock # pylint: disable=import-error def MockDeviceWithFiles(files=None): diff --git a/build/android/devil/utils/mock_calls.py b/build/android/devil/utils/mock_calls.py index bc3b54a..9be1705 100644 --- a/build/android/devil/utils/mock_calls.py +++ b/build/android/devil/utils/mock_calls.py @@ -6,13 +6,12 @@ A test facility to assert call sequences while mocking their behavior. """ -import sys import unittest from devil import devil_env -sys.path.append(devil_env.config.LocalPath('pymock')) -import mock # pylint: disable=F0401 +with devil_env.SysPath(devil_env.config.LocalPath('pymock')): + import mock # pylint: disable=import-error class TestCase(unittest.TestCase): diff --git a/build/android/devil/utils/mock_calls_test.py b/build/android/devil/utils/mock_calls_test.py index 290c184b..b04fb58 100755 --- a/build/android/devil/utils/mock_calls_test.py +++ b/build/android/devil/utils/mock_calls_test.py @@ -9,15 +9,14 @@ Unit tests for the contents of mock_calls.py. import logging import os -import sys import unittest from devil import devil_env from devil.android.sdk import version_codes from devil.utils import mock_calls -sys.path.append(devil_env.config.LocalPath('pymock')) -import mock # pylint: disable=F0401 +with devil_env.SysPath(devil_env.config.LocalPath('pymock')): + import mock # pylint: disable=import-error class _DummyAdb(object): |