Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(423)

Unified Diff: build/android/devil/android/md5sum_test.py

Issue 1316413003: [Android] Add a configurable environment for devil/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/devil/android/md5sum.py ('k') | build/android/devil/android/sdk/aapt.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/devil/android/md5sum_test.py
diff --git a/build/android/devil/android/md5sum_test.py b/build/android/devil/android/md5sum_test.py
index e9481b65080181c606d4269822908145ddccf5c9..4cb5094714507f21f4c61099dc799ef5ad56aeab 100755
--- a/build/android/devil/android/md5sum_test.py
+++ b/build/android/devil/android/md5sum_test.py
@@ -7,25 +7,29 @@ import os
import sys
import unittest
+from devil import devil_env
from devil.android import device_errors
from devil.android import md5sum
-from pylib import constants
-sys.path.append(
- os.path.join(constants.DIR_SOURCE_ROOT, 'third_party', 'pymock'))
+sys.path.append(devil_env.config.pymock_path)
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')
+MD5_DIST = os.path.join(TEST_OUT_DIR, 'md5sum_dist')
class Md5SumTest(unittest.TestCase):
def setUp(self):
+ mocked_attrs = {
+ 'md5sum_host_path': HOST_MD5_EXECUTABLE,
+ 'md5sum_device_path': MD5_DIST,
+ }
self._patchers = [
- mock.patch('pylib.constants.GetOutDirectory',
- new=mock.Mock(return_value=TEST_OUT_DIR)),
- mock.patch('os.path.exists',
- new=mock.Mock(return_value=True)),
+ mock.patch('devil.devil_env._Environment.__getattr__',
+ mock.Mock(side_effect=lambda a: mocked_attrs[a])),
+ mock.patch('os.path.exists',
+ new=mock.Mock(return_value=True)),
]
for p in self._patchers:
p.start()
« no previous file with comments | « build/android/devil/android/md5sum.py ('k') | build/android/devil/android/sdk/aapt.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698