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

Side by Side Diff: recipe_modules/context/tests/env.py

Issue 2920223011: [context] fix treatment of None in env. (Closed)
Patch Set: really fix it Created 3 years, 6 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
« no previous file with comments | « recipe_modules/context/api.py ('k') | recipe_modules/context/tests/env.expected/basic.json » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2017 The LUCI Authors. All rights reserved. 1 # Copyright 2017 The LUCI Authors. All rights reserved.
2 # Use of this source code is governed under the Apache License, Version 2.0 2 # Use of this source code is governed under the Apache License, Version 2.0
3 # that can be found in the LICENSE file. 3 # that can be found in the LICENSE file.
4 4
5 DEPS = [ 5 DEPS = [
6 "context", 6 "context",
7 "path", 7 "path",
8 "step", 8 "step",
9 ] 9 ]
10 10
(...skipping 17 matching lines...) Expand all
28 pants = api.path['start_dir'].join('pants') 28 pants = api.path['start_dir'].join('pants')
29 shirt = api.path['start_dir'].join('shirt') 29 shirt = api.path['start_dir'].join('shirt')
30 with api.context(env={'FOO': api.context.Prefix(pants, shirt)}): 30 with api.context(env={'FOO': api.context.Prefix(pants, shirt)}):
31 api.step('env step with prefix', ['bash', '-c', 'echo $FOO']) 31 api.step('env step with prefix', ['bash', '-c', 'echo $FOO'])
32 32
33 # Can set the path of default environment variables. 33 # Can set the path of default environment variables.
34 with api.context(env={'FOO': api.context.Prefix(shirt)}): 34 with api.context(env={'FOO': api.context.Prefix(shirt)}):
35 api.step('env with default value', 35 api.step('env with default value',
36 ['bash', '-c', 'echo $FOO']) 36 ['bash', '-c', 'echo $FOO'])
37 37
38 # Can cause envvars to be dropped completely.
39 with api.context(env={"PYTHONPATH": None}):
40 api.step('drop PYTHONPATH', ['bash', '-c', 'set'])
41
38 42
39 def GenTests(api): 43 def GenTests(api):
40 yield api.test('basic') 44 yield api.test('basic')
41 45
OLDNEW
« no previous file with comments | « recipe_modules/context/api.py ('k') | recipe_modules/context/tests/env.expected/basic.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698