[autotest] Inline helper methods
BUG=chromium:672348
TEST=None
Change-Id: I3c2457e578edd44a763014936fa70e351fce5924
Reviewed-on: https://chromium-review.googlesource.com/453269
Commit-Ready: Allen Li <ayatane@chromium.org>
Tested-by: Allen Li <ayatane@chromium.org>
Reviewed-by: Aviv Keshet <akeshet@chromium.org>
diff --git a/server/cros/dynamic_suite/suite.py b/server/cros/dynamic_suite/suite.py
index 59aa641..a324a33 100644
--- a/server/cros/dynamic_suite/suite.py
+++ b/server/cros/dynamic_suite/suite.py
@@ -555,25 +555,17 @@
return (path for path in paths if not matcher.match(path))
- def _nonbatch_get_control_file_texts(self, paths):
- """Get control file content for given files.
-
- @param paths: iterable of control file paths
- @returns: generator yielding (path, text) tuples
- """
- for path in paths:
- yield path, self._cf_getter.get_control_file_contents(path)
-
-
def _get_control_file_texts_for_suite(self, suite_name):
"""Get control file content for given suite.
@param suite_name: If specified, this method will attempt to restrain
the search space to just this suite's control files.
+ @returns: generator yielding (path, text) tuples
"""
files = self._cf_getter.get_control_file_list(suite_name=suite_name)
filtered_files = self._filter_cf_paths(files)
- return self._nonbatch_get_control_file_texts(filtered_files)
+ for path in filtered_files:
+ yield path, self._cf_getter.get_control_file_contents(path)
class _BatchControlFileRetriever(_ControlFileRetriever):
@@ -585,22 +577,12 @@
@param suite_name: If specified, this method will attempt to restrain
the search space to just this suite's control files.
+ @returns: generator yielding (path, text) tuples
"""
suite_info = self._cf_getter.get_suite_info(suite_name=suite_name)
files = suite_info.keys()
filtered_files = self._filter_cf_paths(files)
- return self._batch_get_control_file_texts(
- suite_info, filtered_files)
-
-
- def _batch_get_control_file_texts(self, suite_info, paths):
- """Get control file content for given files.
-
- @param suite_info: dict mapping paths to control file text
- @param paths: iterable of control file paths
- @returns: generator yielding (path, text) tuples
- """
- for path in paths:
+ for path in filtered_files:
yield path, suite_info[path]