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

Unified Diff: recipe_modules/context/examples/full.py

Issue 2913203002: [step_runner] run _merge_envs in simulation too. (Closed)
Patch Set: quotes and comments Created 3 years, 7 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/context/api.py ('k') | recipe_modules/step/examples/full.expected/basic.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: recipe_modules/context/examples/full.py
diff --git a/recipe_modules/context/examples/full.py b/recipe_modules/context/examples/full.py
index 4a9c13ff8b3d29e8cca3211f3db6e811879cbd08..960ef0ee6a63bb2fc7943b1416be1dcb57080eef 100644
--- a/recipe_modules/context/examples/full.py
+++ b/recipe_modules/context/examples/full.py
@@ -27,9 +27,22 @@ def RunSteps(api):
api.step('other subdir step', ['bash', '-c', 'echo hi again!'])
# can set envvars
- with api.context(env={"HELLO": "WORLD", "HOME": None}):
+ with api.context(env={'HELLO': 'WORLD', 'HOME': None}):
api.step('env step', ['bash', '-c', 'echo $HELLO; echo $HOME'])
+ # %-formats are errors (for now). Double-% escape them.
+ bad_examples = ['%format', '%s']
+ for example in bad_examples:
+ try:
+ with api.context(env={'BAD': example}):
+ assert False # pragma: no cover
+ except ValueError:
+ pass
+
+ # this is fine though:
+ with api.context(env={'FINE': '%%format'}):
+ pass
+
# can increment nest level... note that this is a low level api, prefer
# api.step.nest instead:
# YES:
« no previous file with comments | « recipe_modules/context/api.py ('k') | recipe_modules/step/examples/full.expected/basic.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698