diff options
| author | Joshua Harlow <harlowja@yahoo-inc.com> | 2014-08-29 14:48:22 -0700 |
|---|---|---|
| committer | Joshua Harlow <harlowja@yahoo-inc.com> | 2014-12-04 08:05:09 +0000 |
| commit | c69884209a73792e85c2e8d2c5b1fab8685847cd (patch) | |
| tree | 84af359393cc8412d14a8f804a3a200acd1ba8c7 /taskflow/tests/unit/worker_based | |
| parent | 87abb27f1759fdce06c72fcbd2ece69ab06c5ea4 (diff) | |
| download | taskflow-c69884209a73792e85c2e8d2c5b1fab8685847cd.tar.gz | |
Be explicit about publish keyword arguments
Instead of allowing for arbitrary keyword arguments which
makes the API hard to change in the future prefer to have
explicit arguments (and keyword arguments) instead of allowing
**kwargs to be passed.
Change-Id: I374db6b19ef76c2f9ee04771f5d928c79b7cf049
Diffstat (limited to 'taskflow/tests/unit/worker_based')
| -rw-r--r-- | taskflow/tests/unit/worker_based/test_executor.py | 12 | ||||
| -rw-r--r-- | taskflow/tests/unit/worker_based/test_proxy.py | 11 |
2 files changed, 11 insertions, 12 deletions
diff --git a/taskflow/tests/unit/worker_based/test_executor.py b/taskflow/tests/unit/worker_based/test_executor.py index d2b97bf..ba73ad7 100644 --- a/taskflow/tests/unit/worker_based/test_executor.py +++ b/taskflow/tests/unit/worker_based/test_executor.py @@ -214,8 +214,8 @@ class TestWorkerTaskExecutor(test.MockTestCase): self.task_args, None, self.timeout), mock.call.request.transition_and_log_error(pr.PENDING, logger=mock.ANY), - mock.call.proxy.publish(msg=self.request_inst_mock, - routing_key=self.executor_topic, + mock.call.proxy.publish(self.request_inst_mock, + self.executor_topic, reply_to=self.executor_uuid, correlation_id=self.task_uuid) ] @@ -236,8 +236,8 @@ class TestWorkerTaskExecutor(test.MockTestCase): result=self.task_result), mock.call.request.transition_and_log_error(pr.PENDING, logger=mock.ANY), - mock.call.proxy.publish(msg=self.request_inst_mock, - routing_key=self.executor_topic, + mock.call.proxy.publish(self.request_inst_mock, + self.executor_topic, reply_to=self.executor_uuid, correlation_id=self.task_uuid) ] @@ -267,8 +267,8 @@ class TestWorkerTaskExecutor(test.MockTestCase): self.task_args, None, self.timeout), mock.call.request.transition_and_log_error(pr.PENDING, logger=mock.ANY), - mock.call.proxy.publish(msg=self.request_inst_mock, - routing_key=self.executor_topic, + mock.call.proxy.publish(self.request_inst_mock, + self.executor_topic, reply_to=self.executor_uuid, correlation_id=self.task_uuid), mock.call.request.transition_and_log_error(pr.FAILURE, diff --git a/taskflow/tests/unit/worker_based/test_proxy.py b/taskflow/tests/unit/worker_based/test_proxy.py index 4217a72..a3c7d13 100644 --- a/taskflow/tests/unit/worker_based/test_proxy.py +++ b/taskflow/tests/unit/worker_based/test_proxy.py @@ -16,10 +16,9 @@ import socket -from six.moves import mock - from taskflow.engines.worker_based import proxy from taskflow import test +from taskflow.test import mock from taskflow.utils import threading_utils @@ -133,24 +132,24 @@ class TestProxy(test.MockTestCase): msg_mock.to_dict.return_value = msg_data routing_key = 'routing-key' task_uuid = 'task-uuid' - kwargs = dict(a='a', b='b') self.proxy(reset_master_mock=True).publish( - msg_mock, routing_key, correlation_id=task_uuid, **kwargs) + msg_mock, routing_key, correlation_id=task_uuid) master_mock_calls = [ mock.call.Queue(name=self._queue_name(routing_key), exchange=self.exchange_inst_mock, routing_key=routing_key, durable=False, - auto_delete=True), + auto_delete=True, + channel=None), mock.call.producer.publish(body=msg_data, routing_key=routing_key, exchange=self.exchange_inst_mock, correlation_id=task_uuid, declare=[self.queue_inst_mock], type=msg_mock.TYPE, - **kwargs) + reply_to=None) ] self.master_mock.assert_has_calls(master_mock_calls) |
