Chromium Code Reviews| Index: recipes/engine_tests/whitelist_steps.py |
| diff --git a/recipes/engine_tests/whitelist_steps.py b/recipes/engine_tests/whitelist_steps.py |
| index bbc41a8d5b4c6dcca0174afa6837206a9e89d899..2ef8f74c247a17eeff2816529b5381d612203f26 100644 |
| --- a/recipes/engine_tests/whitelist_steps.py |
| +++ b/recipes/engine_tests/whitelist_steps.py |
| @@ -4,32 +4,43 @@ |
| """Tests that step_data can accept multiple specs at once.""" |
| +from recipe_engine.recipe_api import Property |
| +from recipe_engine.post_process import NewFilter, DoesntRun, MustRun |
| + |
| DEPS = [ |
| 'step', |
| + 'properties', |
| ] |
| -def RunSteps(api): |
| +PROPERTIES = { |
| + 'fakeit': Property(kind=bool, default=True), |
| +} |
| + |
| +def RunSteps(api, fakeit): |
| api.step('something unimportant', ['echo', 'sup doc']) |
| api.step('something important', ['echo', 'crazy!'], env={'FLEEM': 'VERY YES'}) |
| api.step('another important', ['echo', 'INSANITY']) |
| + if fakeit: |
| + api.step('fakestep', ['echo', 'FAAAAKE']) |
| + |
| def GenTests(api): |
|
martiniss
2016/10/03 19:14:19
No NewFilter with regex.
iannucci
2016/10/06 22:47:12
yeah I'm going to add real tests for all that.
|
| - yield api.test('all_steps') |
| + yield api.test('all_steps') + api.post_process(MustRun, 'fakestep') |
| yield (api.test('single_step') |
| - + api.whitelist('something important') |
| + + api.post_process(NewFilter('something important')) |
| ) |
| yield (api.test('two_steps') |
| - + api.whitelist('something important') |
| - + api.whitelist('another important') |
| + + api.post_process(NewFilter('something important', 'another important')) |
| ) |
| - yield (api.test('selection') |
| - + api.whitelist('something important', 'env') |
| - + api.whitelist('another important', 'cmd') |
| + f = NewFilter() |
| + f = f.include('something important', 'env') |
| + f = f.include('another important', 'cmd') |
| + yield (api.test('selection') + api.properties() |
| + + api.post_process(f) |
| + + api.post_process(DoesntRun, 'fakestep') |
| ) |
| - yield (api.test('result') |
| - + api.whitelist('$result') |
| - ) |
| + yield api.test('result') + api.post_process(NewFilter('$result')) |