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

Unified Diff: recipe_modules/file/test_api.py

Issue 2993713003: Add file.filesizes to recipe engine core modules. (Closed)
Patch Set: Created 3 years, 4 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: recipe_modules/file/test_api.py
diff --git a/recipe_modules/file/test_api.py b/recipe_modules/file/test_api.py
index 0b61c740cb26929d8693721ab844de7a180229fe..409e21f74c8e1720f31e0ab0338bc9a01e51d269 100644
--- a/recipe_modules/file/test_api.py
+++ b/recipe_modules/file/test_api.py
@@ -28,6 +28,20 @@ class FileTestApi(recipe_test_api.RecipeTestApi):
return (self.m.raw_io.stream_output('\n'.join(sorted(map(_check, names))))
+ self.errno(errno_name))
+ def filesizes(self, sizes=(), errno_name=0):
+ """Provides test mock for the `filesizes` method.
+
+ Args:
+ sizes (iterable[int]) - The list of sizes to return.
+ errno_name (str|None) - The error name for this step to return, if any.
+
+ Example:
+ yield (api.test('my_test')
+ + api.step_data('filesize step name', api.file.filesizes([1674, 5714]))
+ """
+ return (self.m.raw_io.stream_output('\n'.join(sizes))
+ + self.errno(errno_name))
+
def read_text(self, text_content='', errno_name=0):
"""Provides test mock for the `read_text` method.
« recipe_modules/file/resources/fileutil.py ('K') | « recipe_modules/file/resources/fileutil.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698