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 |
luqui
2015/11/16 20:48:00
Seems like these should be in recipes/engine_tests
martiniss
2015/11/18 01:00:00
Sure, that's fine. Moved.
|
+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')) |
+ ) |