Chromium Code Reviews| Index: recipes/engine_tests/step_stack_exhaustion.py |
| diff --git a/recipes/engine_tests/step_stack_exhaustion.py b/recipes/engine_tests/step_stack_exhaustion.py |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8dc3e549a2d417d5de235cb1fec05bb138c70141 |
| --- /dev/null |
| +++ b/recipes/engine_tests/step_stack_exhaustion.py |
| @@ -0,0 +1,35 @@ |
| +# Copyright 2015 The LUCI Authors. All rights reserved. |
|
tandrii(chromium)
2017/05/17 08:00:18
s/2015/2017
iannucci
2017/05/17 08:06:51
Done.
|
| +# Use of this source code is governed under the Apache License, Version 2.0 |
| +# that can be found in the LICENSE file. |
| + |
| +"""Tests that step_data can accept multiple specs at once.""" |
| + |
| +from recipe_engine.util import InputPlaceholder |
| +from recipe_engine.recipe_api import StepFailure |
| + |
| +DEPS = [ |
| + 'step', |
| +] |
| + |
| +class BadPlaceholder(InputPlaceholder): |
| + def render(self, test): |
| + raise StepFailure("EXPLOSION") |
| + |
| + |
| +def RunSteps(api): |
| + try: |
| + api.step('innocent step', ['echo', 'some', 'step']) |
| + |
| + ph = BadPlaceholder('name') |
| + ph.namespaces = ('fake', 'namespace') |
| + |
| + api.step('bad step', ['echo', ph]) |
| + finally: |
| + api.step.active_result # this will raise a ValueError |
|
tandrii(chromium)
2017/05/17 08:00:18
s/t #/t #/
iannucci
2017/05/17 08:06:51
Done.
|
| + |
| +def GenTests(api): |
| + yield ( |
| + api.test('basic') + |
| + api.expect_exception('ValueError') |
| + ) |
| + |