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

Unified Diff: recipe_modules/json/example.py

Issue 1773273003: Make output placeholders like json.output index-able by name. (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/recipes-py@master
Patch Set: Rebase uppon https://codereview.chromium.org/1785543004/ Created 4 years, 9 months 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: recipe_modules/json/example.py
diff --git a/recipe_modules/json/example.py b/recipe_modules/json/example.py
index 38b50d57b4eebccba0b0b21c802d72de25edb18c..ad0eca5b4504993d5d502f8bb244754cf9cc8ff3 100644
--- a/recipe_modules/json/example.py
+++ b/recipe_modules/json/example.py
@@ -37,9 +37,10 @@ def RunSteps(api):
with open(sys.argv[2], 'w') as f:
f.write(json.dumps(['x', 'y', %s]))
""" % repr(FULLWIDTH_Z),
- args=[api.json.output(), api.json.output()],
+ args=[api.json.output(name='1'), api.json.output(name='2')],
)
- assert result.json.output_all == [[1, 2, 3], ['x', 'y', FULLWIDTH_Z]]
+ assert result.json.outputs['1'] == [1, 2, 3]
+ assert result.json.outputs['2'] == ['x', 'y', FULLWIDTH_Z]
example_dict = {'x': 1, 'y': 2}
@@ -66,6 +67,6 @@ def GenTests(api):
api.step_data('echo1', stdout=api.json.output([1, 2, 3])) +
api.step_data(
'foo',
- api.json.output([1, 2, 3]) +
- api.json.output(['x', 'y', FULLWIDTH_Z]),
+ api.json.output([1, 2, 3], name='1') +
+ api.json.output(['x', 'y', FULLWIDTH_Z], name='2'),
))

Powered by Google App Engine
This is Rietveld 408576698