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

Side by Side 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 unified diff | Download patch
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 DEPS = [ 5 DEPS = [
6 'infra_paths', 6 'infra_paths',
7 'recipe_engine/path',
7 'recipe_engine/platform', 8 'recipe_engine/platform',
8 'recipe_engine/properties', 9 'recipe_engine/properties',
9 'recipe_engine/step', 10 'recipe_engine/step',
10 ] 11 ]
11 12
12 from recipe_engine.config_types import Path 13 from recipe_engine.config_types import Path
13 14
14 def RunSteps(api): 15 def RunSteps(api):
15 api.step('step', [], cwd=api.infra_paths['slave_build']) 16 api.step('step', [], cwd=api.infra_paths['slave_build'])
16 17
18 if api.path.exists(api.infra_paths['slave_build'].join('foo.txt')):
19 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
20
17 21
18 def GenTests(api): 22 def GenTests(api):
19 for platform in ('linux', 'win', 'mac'): 23 for platform in ('linux', 'win', 'mac'):
20 yield (api.test(platform) + api.platform.name(platform)) 24 yield (api.test(platform) +
25 api.platform.name(platform) +
26 api.infra_paths.exists(
27 api.infra_paths['slave_build'].join('foo.txt')))
21 28
22 yield (api.test('%s_kitchen' % platform) + 29 yield (api.test('%s_kitchen' % platform) +
23 api.platform.name(platform) + 30 api.platform.name(platform) +
24 api.properties(path_config='kitchen')) 31 api.properties(path_config='kitchen'))
OLDNEW
« 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