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

Unified Diff: scripts/slave/recipe_modules/path/api.py

Issue 23889036: Refactor the way that TestApi works so that it is actually useful. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: License headers Created 7 years, 3 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 | « scripts/slave/recipe_modules/json/util.py ('k') | scripts/slave/recipe_modules/path/test_api.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/slave/recipe_modules/path/api.py
diff --git a/scripts/slave/recipe_modules/path/api.py b/scripts/slave/recipe_modules/path/api.py
index c5c82d60cbc168b114b3311c8d8a2f9b134d9423..a7e89f7a8b1e208c02f3323d18e1ca38669d7c61 100644
--- a/scripts/slave/recipe_modules/path/api.py
+++ b/scripts/slave/recipe_modules/path/api.py
@@ -100,7 +100,7 @@ class PathApi(recipe_api.RecipeApi):
def __init__(self, **kwargs):
super(PathApi, self).__init__(**kwargs)
- if self._mock is None: # pragma: no cover
+ if not self._test_data.enabled: # pragma: no cover
self._path_mod = os.path
# e.g. /b/build/slave/<slavename>/build
self.slave_build = path_method(
@@ -113,7 +113,7 @@ class PathApi(recipe_api.RecipeApi):
setattr(self, token, path_method(self, token, self.join(r, token)))
self.root = path_method(self, 'root', r)
else:
- self._path_mod = mock_path(self.m, self._mock.get('exists', []))
+ self._path_mod = mock_path(self.m, self._test_data.get('exists', []))
self.slave_build = path_method(self, 'slave_build', '[SLAVE_BUILD_ROOT]')
self.build_internal = path_method(
self, 'build_internal', '[BUILD_INTERNAL_ROOT]')
@@ -144,7 +144,7 @@ class PathApi(recipe_api.RecipeApi):
def mock_add_paths(self, path):
"""For testing purposes, assert that |path| exists."""
- if self._mock is not None:
+ if self._test_data.enabled:
self._path_mod.mock_add_paths(path)
def add_checkout(self, checkout, *pieces):
« no previous file with comments | « scripts/slave/recipe_modules/json/util.py ('k') | scripts/slave/recipe_modules/path/test_api.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698