| Index: recipes/bottom.py
|
| diff --git a/recipes/bottom.py b/recipes/bottom.py
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..207f2d12d4b7e7fe2069e826ed2febefcb687898
|
| --- /dev/null
|
| +++ b/recipes/bottom.py
|
| @@ -0,0 +1,33 @@
|
| +from recipe_engine.recipe_api import Property
|
| +from recipe_engine import config
|
| +
|
| +DEPS = [
|
| + 'raw_io',
|
| + 'recipe_engine/properties',
|
| + 'step',
|
| +]
|
| +
|
| +PROPERTIES = {
|
| + 'number': Property(kind=int),
|
| +}
|
| +
|
| +RETURN_SCHEMA = config.ReturnSchema(
|
| + number_times_two=config.Single(int),
|
| +)
|
| +
|
| +def RunSteps(api, number):
|
| + # Newline cause bc complains if it doesn't have it
|
| + num_s = '%s*%s\n' % (number, 2)
|
| + result = api.step(
|
| + 'calc it', ['bc'],
|
| + stdin=api.raw_io.input(data=num_s),
|
| + stdout=api.raw_io.output('out'))
|
| + return RETURN_SCHEMA(number_times_two=int(result.stdout))
|
| +
|
| +def GenTests(api):
|
| + yield (
|
| + api.test('basic') +
|
| + api.properties(number=3) +
|
| + api.step_data('calc it',
|
| + stdout=api.raw_io.output('6'))
|
| + )
|
|
|