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

Side by Side Diff: recipe_modules/properties/example.py

Issue 1344583003: Recipe package system. (Closed) Base URL: git@github.com:luci/recipes-py.git@master
Patch Set: Recompiled proto Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « recipe_modules/properties/api.py ('k') | recipe_modules/python/__init__.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 from infra.libs.infra_types import thaw
6 from recipe_engine.recipe_api import Property 5 from recipe_engine.recipe_api import Property
7 6
8 DEPS = ['properties', 'step'] 7 DEPS = [
8 'recipe_engine/properties',
9 'recipe_engine/step',
10 ]
9 11
10 PROPERTIES = { 12 PROPERTIES = {
11 'test_prop': Property(), 13 'test_prop': Property(),
12 } 14 }
13 15
14 def RunSteps(api, test_prop): 16 def RunSteps(api, test_prop):
15 api.step('echo', ['echo'] + [repr(test_prop)]) 17 api.step('echo', ['echo'] + [repr(test_prop)])
16 api.step('echo all', ['echo'] + [repr(api.properties.thaw())]) 18 api.step('echo all', ['echo'] + [repr(api.properties.thaw())])
17 19
18 def GenTests(api): 20 def GenTests(api):
19 yield api.test('basic') + api.properties( 21 yield api.test('basic') + api.properties(
20 test_prop={'key': 'value'}) 22 test_prop={'key': 'value'})
21 yield api.test('lists') + api.properties( 23 yield api.test('lists') + api.properties(
22 test_prop={'key': ['value', ['value']]}) 24 test_prop={'key': ['value', ['value']]})
23 yield api.test('dicts') + api.properties( 25 yield api.test('dicts') + api.properties(
24 test_prop={'key': {'key': 'value', 'other_key': {'key': 'value'}}}) 26 test_prop={'key': {'key': 'value', 'other_key': {'key': 'value'}}})
25 27
26 yield ( 28 yield (
27 api.test('exception') + 29 api.test('exception') +
28 api.expect_exception('ValueError') 30 api.expect_exception('ValueError')
29 ) 31 )
30
OLDNEW
« no previous file with comments | « recipe_modules/properties/api.py ('k') | recipe_modules/python/__init__.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698