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

Unified Diff: recipe_modules/context/tests/env.py

Issue 2925453002: [context] Add path prefix/suffix manipulation. (Closed)
Patch Set: comments 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 side-by-side diff with in-line comments
Download patch
Index: recipe_modules/context/tests/env.py
diff --git a/recipe_modules/context/tests/env.py b/recipe_modules/context/tests/env.py
index 817050a199d4f9ed001d5b2e33e1cedd08fd14e1..867e27ea9f90e8c30a6c6a1c34c46a2526bbab5b 100644
--- a/recipe_modules/context/tests/env.py
+++ b/recipe_modules/context/tests/env.py
@@ -18,6 +18,24 @@ def RunSteps(api):
with api.context(env={"SOMETHING_ELSE": "0"}):
api.step('with 2 envs', ['echo', 'hello'])
+ with api.context(env={'FOO': 'bar'}):
+ api.step('env step', ['bash', '-c', 'echo $FOO'])
+
+ base_path = 'foo%s%%(FOO)s%sbaz' % (api.path.pathsep, api.path.pathsep)
+ with api.context(env={'FOO': base_path}):
+ api.step('env step augmented', ['bash', '-c', 'echo $FOO'])
+
+ pants = api.path['start_dir'].join('pants')
+ shirt = api.path['start_dir'].join('shirt')
+ with api.context(env={'FOO': api.context.Prefix(pants, shirt)}):
+ api.step('env step with prefix', ['bash', '-c', 'echo $FOO'])
+
+ # Can set the path of default environment variables.
+ with api.context(env={'FOO': api.context.Prefix(shirt)}):
+ api.step('env with default value',
+ ['bash', '-c', 'echo $FOO'])
+
+
def GenTests(api):
yield api.test('basic')

Powered by Google App Engine
This is Rietveld 408576698