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

Unified Diff: recipes/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: 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
« no previous file with comments | « recipes/next_prime.py ('k') | recipes/top.expected/basic.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: recipes/top.py
diff --git a/recipes/top.py b/recipes/top.py
new file mode 100644
index 0000000000000000000000000000000000000000..376ab4efc19267c86fcf4e0572f8bd0f4d128a96
--- /dev/null
+++ b/recipes/top.py
@@ -0,0 +1,24 @@
+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('bottom', {'number': to_pass})
estaab 2015/11/10 02:55:12 Since to_pass is just a plain Property() does that
martiniss 2015/11/13 00:17:12 Technically yes, and naive simulation tests won't
+ return RETURN_SCHEMA(**res)
estaab 2015/11/10 02:55:12 Would "return {'result': res['result']}" also be v
martiniss 2015/11/13 00:17:12 Yes.
+
+def GenTests(api):
+ yield (
+ api.test('basic') +
+ api.properties(to_pass=3)
+ )
« no previous file with comments | « recipes/next_prime.py ('k') | recipes/top.expected/basic.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698