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

Unified Diff: recipe_modules/raw_io/example.py

Issue 2672593002: raw_io module: Add text_input and text_output (Closed)
Patch Set: Change approach Created 3 years, 11 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
« recipe_modules/raw_io/api.py ('K') | « recipe_modules/raw_io/api.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: recipe_modules/raw_io/example.py
diff --git a/recipe_modules/raw_io/example.py b/recipe_modules/raw_io/example.py
index 6c565de4577477c4529d9f15fa39674f4ffc207f..8e1ba81cba26655bc902209e0f555915371b28c3 100644
--- a/recipe_modules/raw_io/example.py
+++ b/recipe_modules/raw_io/example.py
@@ -21,10 +21,17 @@ def RunSteps(api):
# Pass stuff to command's stdin, read it from stdout.
step_result = api.step('cat', ['cat'],
- stdin=api.raw_io.input(data='hello'),
+ stdin=api.raw_io.text_input(data='hello'),
stdout=api.raw_io.output('out'))
assert step_result.stdout == 'hello'
+ # TODO(martiniss): comment back in this test case
+ step_result = api.step('cat', ['echo'],
+ stdin=api.raw_io.input(data='\xe2hello'),
+ stdout=api.raw_io.output('\xe2hello'))
+ import pdb; pdb.set_trace()
+ assert step_result.stdout == '\xe2hello'
+
# Example of auto-mocking stdout. '\n' appended to mock 'echo' behavior.
step_result = api.step('automock', ['echo', 'huh'],
stdout=api.raw_io.output('out'),
« recipe_modules/raw_io/api.py ('K') | « recipe_modules/raw_io/api.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698