[autotest] Fix naming and docstring for test_for()
BUG=chromium:707999
TEST=Run unit tests
Change-Id: Ie9f2c220597eb0f52159d4c2923a9b619839459a
Reviewed-on: https://chromium-review.googlesource.com/446881
Commit-Ready: Allen Li <ayatane@chromium.org>
Tested-by: Allen Li <ayatane@chromium.org>
Reviewed-by: Prathmesh Prabhu <pprabhu@chromium.org>
diff --git a/server/cros/provision.py b/server/cros/provision.py
index 9762785..ae61a15 100644
--- a/server/cros/provision.py
+++ b/server/cros/provision.py
@@ -172,16 +172,16 @@
@classmethod
- def test_for(cls, label):
+ def action_for(cls, name):
"""
- Returns the test associated with the given (string) label name.
+ Returns the action associated with the given (string) name.
- @param label: The label for which the action is being requested.
- @returns: The string name of the test that should be run.
+ @param name: The name associated with the action requested.
+ @returns: The requested Actionable.
@raises KeyError: If the name was not recognized as one we care about.
"""
- return cls._actions[label]
+ return cls._actions[name]
@classmethod
@@ -394,7 +394,7 @@
# Sort the configuration labels based on `task._priorities`.
sorted_configurations = task.sort_configurations(configurations)
for name, value in sorted_configurations:
- action_item = task.test_for(name)
+ action_item = task.action_for(name)
success = action_item.execute(job=job, host=host, value=value)
if not success:
raise SpecialTaskActionException()