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

Unified Diff: recipe_modules/file/test_api.py

Issue 2993713003: Add file.filesizes to recipe engine core modules. (Closed)
Patch Set: -kwargs. 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
« no previous file with comments | « recipe_modules/file/resources/fileutil.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..6d9995f15c9d072fc507d932e136db8147aeeece 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(map(str, sizes)))
+ + self.errno(errno_name))
+
def read_text(self, text_content='', errno_name=0):
"""Provides test mock for the `read_text` method.
« no previous file with comments | « recipe_modules/file/resources/fileutil.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698