From ab40ef64063b19739b8558feaee828f71e91eb56 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Mon, 17 Nov 2014 21:33:06 +0000 Subject: [PATCH] Fix a copy/pasted test mistake Fix a minor test mistake that was copied around a few times. In mock setup, the intention was to only return a value of the rpc method used was a 'call', not 'cast'. Unfortunately, the variable checked was method instead of rpc_method, so this expected return was always set to None. This also points out that what's being tested here isn't what *really* was intended. It ends up testing that the code returns what we mocked it to return, which isn't all that useful. However, at least with this fix it's a bit more clear what it's trying to do. Change-Id: I18e85aa66f83331318177d70cbae2468ff8bb57d --- neutron/tests/unit/hyperv/test_hyperv_rpcapi.py | 2 +- neutron/tests/unit/ml2/test_rpcapi.py | 2 +- neutron/tests/unit/mlnx/test_rpcapi.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/neutron/tests/unit/hyperv/test_hyperv_rpcapi.py b/neutron/tests/unit/hyperv/test_hyperv_rpcapi.py index c9268484f..4dc69d965 100644 --- a/neutron/tests/unit/hyperv/test_hyperv_rpcapi.py +++ b/neutron/tests/unit/hyperv/test_hyperv_rpcapi.py @@ -34,7 +34,7 @@ class rpcHyperVApiTestCase(base.BaseTestCase): def _test_hyperv_neutron_api( self, rpcapi, topic, method, rpc_method, **kwargs): ctxt = context.RequestContext('fake_user', 'fake_project') - expected_retval = 'foo' if method == 'call' else None + expected_retval = 'foo' if rpc_method == 'call' else None expected_version = kwargs.pop('version', None) expected_msg = rpcapi.make_msg(method, **kwargs) diff --git a/neutron/tests/unit/ml2/test_rpcapi.py b/neutron/tests/unit/ml2/test_rpcapi.py index d874d7cbd..ff6233bba 100644 --- a/neutron/tests/unit/ml2/test_rpcapi.py +++ b/neutron/tests/unit/ml2/test_rpcapi.py @@ -167,7 +167,7 @@ class RpcApiTestCase(base.BaseTestCase): def _test_rpc_api(self, rpcapi, topic, method, rpc_method, **kwargs): ctxt = context.RequestContext('fake_user', 'fake_project') - expected_retval = 'foo' if method == 'call' else None + expected_retval = 'foo' if rpc_method == 'call' else None expected_version = kwargs.pop('version', None) expected_msg = rpcapi.make_msg(method, **kwargs) diff --git a/neutron/tests/unit/mlnx/test_rpcapi.py b/neutron/tests/unit/mlnx/test_rpcapi.py index 96e76af1b..fc2d32d1b 100644 --- a/neutron/tests/unit/mlnx/test_rpcapi.py +++ b/neutron/tests/unit/mlnx/test_rpcapi.py @@ -32,7 +32,7 @@ class rpcApiTestCase(base.BaseTestCase): def _test_mlnx_api(self, rpcapi, topic, method, rpc_method, expected_msg=None, **kwargs): ctxt = context.RequestContext('fake_user', 'fake_project') - expected_retval = 'foo' if method == 'call' else None + expected_retval = 'foo' if rpc_method == 'call' else None expected_kwargs = {} if topic: expected_kwargs['topic'] = topic -- 2.45.2