| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |