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

Side by Side Diff: recipes/engine_tests/depend_on/bottom.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 unified diff | Download patch
OLDNEW
(Empty)
1 from recipe_engine.recipe_api import Property
2 from recipe_engine import config
3
4 DEPS = [
5 'raw_io',
6 'recipe_engine/properties',
7 'step',
8 ]
9
10 PROPERTIES = {
11 'number': Property(kind=int),
12 }
13
14 RETURN_SCHEMA = config.ReturnSchema(
15 number_times_two=config.Single(int),
16 )
17
18 def RunSteps(api, number):
19 # Newline cause bc complains if it doesn't have it
20 num_s = '%s*%s\n' % (number, 2)
21 result = api.step(
22 'calc it', ['bc'],
23 stdin=api.raw_io.input(data=num_s),
24 stdout=api.raw_io.output('out'))
25 return RETURN_SCHEMA(number_times_two=int(result.stdout))
26
27 def GenTests(api):
28 yield (
29 api.test('basic') +
30 api.properties(number=3) +
31 api.step_data('calc it',
32 stdout=api.raw_io.output('6'))
33 )
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698