diff options
author | Yuheng Long <yuhenglong@google.com> | 2013-07-11 07:49:01 -0700 |
---|---|---|
committer | ChromeBot <chrome-bot@google.com> | 2013-07-12 15:52:30 -0700 |
commit | 26ec76c8a9d4f5dd023513d2772fa6cd4b6749ea (patch) | |
tree | b87fb33899111b369c1fd26b052ffaeaf1776fa0 /bestflags/pipeline_worker_test.py | |
parent | 49358b75c25a44760e884245440dc96e55812d04 (diff) | |
download | toolchain-utils-26ec76c8a9d4f5dd023513d2772fa6cd4b6749ea.tar.gz |
Rename the methods and use the dummy parameters.
Refactor methods names and substitute unused variables with dummy variables.
BUG=None
TEST=unit testing for the pipeline stage and pipeline workers.
Change-Id: I237d893201853d8620ff886c8fb9012c38b83805
Reviewed-on: https://gerrit-int.chromium.org/40865
Commit-Queue: Yuheng Long <yuhenglong@google.com>
Tested-by: Yuheng Long <yuhenglong@google.com>
Reviewed-by: Simon Que <sque@google.com>
Diffstat (limited to 'bestflags/pipeline_worker_test.py')
-rw-r--r-- | bestflags/pipeline_worker_test.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/bestflags/pipeline_worker_test.py b/bestflags/pipeline_worker_test.py index 3c2b9136..0563852e 100644 --- a/bestflags/pipeline_worker_test.py +++ b/bestflags/pipeline_worker_test.py @@ -45,28 +45,28 @@ class MockTask(object): self._identifier = identifier self._pre_cost = cost - def get_identifier(self, stage): - assert stage == TESTSTAGE - return self._identifier - def __eq__(self, other): if isinstance(other, MockTask): return self._identifier == other._identifier and self._cost == other._cost return False - def set_result(self, stage, cost): + def GetIdentifier(self, stage): + assert stage == TESTSTAGE + return self._identifier + + def SetResult(self, stage, cost): assert stage == TESTSTAGE self._cost = cost - def work(self, stage): + def Work(self, stage): assert stage == TESTSTAGE self._cost = self._pre_cost - def get_result(self, stage): + def GetResult(self, stage): assert stage == TESTSTAGE return self._cost - def done(self, stage): + def Done(self, stage): """Indicates whether the task has been performed.""" assert stage == TESTSTAGE @@ -94,7 +94,7 @@ class AuxiliaryTest(unittest.TestCase): completed_queue = manager.Queue() # Set up the helper process that holds the helper method. - helper_process = multiprocessing.Process(target=pipeline_worker.helper, + helper_process = multiprocessing.Process(target=pipeline_worker.Helper, args=(TESTSTAGE, {}, helper_queue, completed_queue, result_queue)) @@ -154,7 +154,7 @@ class AuxiliaryTest(unittest.TestCase): # Submit the mock tasks to the worker. for mock_task in mock_tasks: - pipeline_worker.worker(TESTSTAGE, mock_task, completed_queue, + pipeline_worker.Worker(TESTSTAGE, mock_task, completed_queue, result_queue) # The tasks, from the output queue, should be the same as the input and @@ -162,7 +162,7 @@ class AuxiliaryTest(unittest.TestCase): for task in mock_tasks: output = result_queue.get() self.assertEqual(output, task) - self.assertTrue(output.done(TESTSTAGE)) + self.assertTrue(output.Done(TESTSTAGE)) # The tasks, from the completed_queue, should be defined in the # mock_work_tasks dictionary. |