| OLD | NEW |
| 1 # Copyright 2015 The LUCI Authors. All rights reserved. | 1 # Copyright 2015 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 | 5 |
| 6 DEPS = [ | 6 DEPS = [ |
| 7 'step', | 7 'step', |
| 8 ] | 8 ] |
| 9 | 9 |
| 10 | 10 |
| 11 def RunSteps(api): | 11 def RunSteps(api): |
| 12 # Nest all steps below this. | 12 # Nest all steps below this. |
| 13 with api.step.nest('complicated thing'): | 13 with api.step.nest('complicated thing'): |
| 14 with api.step.nest('first part'): | 14 with api.step.nest('first part'): |
| 15 api.step('wait a bit', ['sleep', '10']) | 15 api.step('wait a bit', ['sleep', '1']) |
| 16 | 16 |
| 17 # Prefix the name without indenting. | 17 # Prefix the name without indenting. |
| 18 with api.step.context({'name': 'attempt number'}): | 18 with api.step.context({'name': 'attempt number'}): |
| 19 step_result = api.step('one', ['echo', 'herpy']) | 19 step_result = api.step('one', ['echo', 'herpy']) |
| 20 assert step_result.step['name'] == 'complicated thing.attempt number.one' | 20 assert step_result.step['name'] == 'complicated thing.attempt number.one' |
| 21 api.step('two', ['echo', 'derpy']) | 21 api.step('two', ['echo', 'derpy']) |
| 22 | 22 |
| 23 api.step('simple thing', ['sleep', '10']) | 23 api.step('simple thing', ['sleep', '1']) |
| 24 | 24 |
| 25 | 25 |
| 26 def GenTests(api): | 26 def GenTests(api): |
| 27 yield api.test('basic') | 27 yield api.test('basic') |
| OLD | NEW |