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

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

Issue 2439353002: Refactor expectations of properties recipe_module. (Closed)
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | recipe_modules/properties/example.expected/basic.json » ('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 LUCI Authors. All rights reserved. 1 # Copyright 2014 The LUCI Authors. All rights reserved.
2 # Use of this source code is governed under the Apache License, Version 2.0 2 # Use of this source code is governed under the Apache License, Version 2.0
3 # that can be found in the LICENSE file. 3 # that can be found in the LICENSE file.
4 4
5 from recipe_engine.recipe_api import Property 5 from recipe_engine.recipe_api import Property
6 6
7 DEPS = [ 7 DEPS = [
8 'properties', 8 'properties',
9 'step', 9 'step',
10 ] 10 ]
11 11
12 PROPERTIES = { 12 PROPERTIES = {
13 'test_prop': Property(), 13 'test_prop': Property(),
14 'foo.bar-bam': Property(param_name='param_name_test'), 14 'foo.bar-bam': Property(param_name='param_name_test'),
15 } 15 }
16 16
17 def RunSteps(api, test_prop, param_name_test): 17 def RunSteps(api, test_prop, param_name_test):
18 api.step('echo', ['echo'] + [repr(test_prop), repr(param_name_test)]) 18 api.step('echo', ['echo'] + [repr(test_prop), repr(param_name_test)])
19 19
20 properties = api.properties.thaw() 20 properties = api.properties.thaw()
21 api.step('echo all', ['echo'] + 21 api.step('echo all', ['echo'] + map(repr, sorted(properties.iteritems())))
22 [repr(list(sorted(api.properties.thaw().iteritems())))])
23 22
24 # It should behave like a real dictionary. 23 # It should behave like a real dictionary.
25 assert len(properties) == len(api.properties) 24 assert len(properties) == len(api.properties)
26 for k in api.properties: 25 for k in api.properties:
27 assert k in properties 26 assert k in properties
28 # We would assert that v is there too, but sometimes it's frozen... 27 # We would assert that v is there too, but sometimes it's frozen...
29 28
30 29
31 def GenTests(api): 30 def GenTests(api):
32 pd = {'foo.bar-bam': 'thing'} 31 pd = {'foo.bar-bam': 'thing'}
(...skipping 17 matching lines...) Expand all
50 api.properties.scheduled(test_prop=None, **pd)) 49 api.properties.scheduled(test_prop=None, **pd))
51 yield (api.test('buildbot_git_scheduled') + 50 yield (api.test('buildbot_git_scheduled') +
52 api.properties.git_scheduled(test_prop=None, **pd)) 51 api.properties.git_scheduled(test_prop=None, **pd))
53 yield (api.test('buildbot_tryserver') + 52 yield (api.test('buildbot_tryserver') +
54 api.properties.tryserver(test_prop=None, **pd)) 53 api.properties.tryserver(test_prop=None, **pd))
55 yield (api.test('buildbot_tryserver_gerrit') + 54 yield (api.test('buildbot_tryserver_gerrit') +
56 api.properties.tryserver_gerrit( 55 api.properties.tryserver_gerrit(
57 full_project_name='infra/infra', 56 full_project_name='infra/infra',
58 gerrit_host='pdfium-review.googlesource.com', test_prop=None, 57 gerrit_host='pdfium-review.googlesource.com', test_prop=None,
59 **pd)) 58 **pd))
OLDNEW
« no previous file with comments | « no previous file | recipe_modules/properties/example.expected/basic.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698