Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(123)

Unified Diff: recipes/engine_tests/depend_on/top.py

Issue 1421843006: Add simple depends_on API. (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/recipes-py@master
Patch Set: Remove old expectation, move tests to their own folder. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: recipes/engine_tests/depend_on/top.py
diff --git a/recipes/engine_tests/depend_on/top.py b/recipes/engine_tests/depend_on/top.py
new file mode 100644
index 0000000000000000000000000000000000000000..0693c4b5188630d46e89ad4b201555520a4afdfe
--- /dev/null
+++ b/recipes/engine_tests/depend_on/top.py
@@ -0,0 +1,25 @@
+from recipe_engine.recipe_api import Property
+from recipe_engine import config
+
+DEPS = [
+ 'recipe_engine/properties',
+]
+
+PROPERTIES = {
+ 'to_pass': Property(),
+}
+
+RETURN_SCHEMA = config.ReturnSchema(
+ result=config.Single(int),
+)
+
+def RunSteps(api, to_pass):
+ res = api.depend_on('engine_tests/depend_on/bottom', {'number': to_pass})
+ return RETURN_SCHEMA(result=res['number_times_two'])
+
+def GenTests(api):
+ yield (
+ api.test('basic') +
+ api.properties(to_pass=3) +
+ api.depend_on('engine_tests/depend_on/bottom', {'number': 3}, {'number_times_two': 6})
+ )
« no previous file with comments | « recipes/engine_tests/depend_on/no_return.expected/basic.json ('k') | recipes/engine_tests/depend_on/top.expected/basic.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698