OLD | NEW |
(Empty) | |
| 1 from recipe_engine.recipe_api import Property |
| 2 from recipe_engine import config |
| 3 |
| 4 DEPS = [ |
| 5 'raw_io', |
| 6 'recipe_engine/properties', |
| 7 'step', |
| 8 ] |
| 9 |
| 10 PROPERTIES = { |
| 11 'number': Property(kind=int), |
| 12 } |
| 13 |
| 14 RETURN_SCHEMA = config.ReturnSchema( |
| 15 number_times_two=config.Single(int), |
| 16 ) |
| 17 |
| 18 def RunSteps(api, number): |
| 19 # Newline cause bc complains if it doesn't have it |
| 20 num_s = '%s*%s\n' % (number, 2) |
| 21 result = api.step( |
| 22 'calc it', ['bc'], |
| 23 stdin=api.raw_io.input(data=num_s), |
| 24 stdout=api.raw_io.output('out')) |
| 25 return RETURN_SCHEMA(number_times_two=int(result.stdout)) |
| 26 |
| 27 def GenTests(api): |
| 28 yield ( |
| 29 api.test('basic') + |
| 30 api.properties(number=3) + |
| 31 api.step_data('calc it', |
| 32 stdout=api.raw_io.output('6')) |
| 33 ) |
OLD | NEW |