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

Unified Diff: recipe_modules/infra_paths/example.py

Issue 1915113006: depot_tools: add test_api to infra_paths recipe module (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 4 years, 8 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 | « recipe_modules/infra_paths/api.py ('k') | recipe_modules/infra_paths/example.expected/linux.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: recipe_modules/infra_paths/example.py
diff --git a/recipe_modules/infra_paths/example.py b/recipe_modules/infra_paths/example.py
index 9e6f712faa03f8329cc67480364f801ab30b18bd..f55bf058be549a5984cac164cf0716b0dfccfeab 100644
--- a/recipe_modules/infra_paths/example.py
+++ b/recipe_modules/infra_paths/example.py
@@ -4,6 +4,7 @@
DEPS = [
'infra_paths',
+ 'recipe_engine/path',
'recipe_engine/platform',
'recipe_engine/properties',
'recipe_engine/step',
@@ -14,10 +15,16 @@ from recipe_engine.config_types import Path
def RunSteps(api):
api.step('step', [], cwd=api.infra_paths['slave_build'])
+ if api.path.exists(api.infra_paths['slave_build'].join('foo.txt')):
+ api.step('path exists', [])
Michael Achenbach 2016/04/26 13:22:23 Maybe also demonstrate a path that doesn't exist.
Paweł Hajdan Jr. 2016/04/26 13:23:25 We do. We have tests (*_kitchen) where it doesn't
Michael Achenbach 2016/04/26 13:26:09 Fair enough. An "does not exist" line would also s
+
def GenTests(api):
for platform in ('linux', 'win', 'mac'):
- yield (api.test(platform) + api.platform.name(platform))
+ yield (api.test(platform) +
+ api.platform.name(platform) +
+ api.infra_paths.exists(
+ api.infra_paths['slave_build'].join('foo.txt')))
yield (api.test('%s_kitchen' % platform) +
api.platform.name(platform) +
« no previous file with comments | « recipe_modules/infra_paths/api.py ('k') | recipe_modules/infra_paths/example.expected/linux.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698