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

Unified Diff: recipes/engine_tests/whitelist_steps.py

Issue 2387763003: Add initial postprocess unit test thingy. (Closed)
Patch Set: Rebase Created 4 years, 2 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: recipes/engine_tests/whitelist_steps.py
diff --git a/recipes/engine_tests/whitelist_steps.py b/recipes/engine_tests/whitelist_steps.py
index bbc41a8d5b4c6dcca0174afa6837206a9e89d899..7b365d7c34388bd9b60c2103ebd1beefa65ef861 100644
--- a/recipes/engine_tests/whitelist_steps.py
+++ b/recipes/engine_tests/whitelist_steps.py
@@ -4,32 +4,44 @@
"""Tests that step_data can accept multiple specs at once."""
+from recipe_engine.recipe_api import Property
+from recipe_engine.post_process import Filter, DoesNotRun, MustRun
+
DEPS = [
'step',
+ 'properties',
]
-def RunSteps(api):
+PROPERTIES = {
+ 'fakeit': Property(kind=bool, default=True),
+}
+
+def RunSteps(api, fakeit):
api.step('something unimportant', ['echo', 'sup doc'])
api.step('something important', ['echo', 'crazy!'], env={'FLEEM': 'VERY YES'})
api.step('another important', ['echo', 'INSANITY'])
+ if fakeit:
+ api.step('fakestep', ['echo', 'FAAAAKE'])
+
def GenTests(api):
- yield api.test('all_steps')
+ yield api.test('all_steps') + api.post_process(MustRun, 'fakestep')
yield (api.test('single_step')
- + api.whitelist('something important')
+ + api.post_process(Filter('something important'))
)
yield (api.test('two_steps')
- + api.whitelist('something important')
- + api.whitelist('another important')
+ + api.post_process(Filter('something important', 'another important'))
)
+ f = Filter()
+ f = f.include('another important', ['cmd'])
+ f = f.include('something important', ['env'])
yield (api.test('selection')
- + api.whitelist('something important', 'env')
- + api.whitelist('another important', 'cmd')
+ + api.properties(fakeit=False)
+ + api.post_process(DoesNotRun, 'fakestep')
+ + api.post_process(f)
)
- yield (api.test('result')
- + api.whitelist('$result')
- )
+ yield api.test('result') + api.post_process(Filter('$result'))
« no previous file with comments | « recipe_engine/unittests/post_process_test.py ('k') | recipes/engine_tests/whitelist_steps.expected/all_steps.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698