Fix a couple of unit test typos
There were two cases in rpcapi unit tests where it was checking method instead of rpc_method. Fix up the typo and the reason why the typo didn't matter before. Also fix two places where rpcapi code had a return for a cast(), which is now caught by the unit tests. Closes-bug: #1272518 Change-Id: Ib5e3a002f6b0f7eb8dee8bd84bd53dbf817017f7
This commit is contained in:
parent
5e08f52525
commit
0b8267aa83
@ -284,7 +284,7 @@ class NetworkAPI(object):
|
||||
|
||||
def update_dns(self, ctxt, network_ids):
|
||||
cctxt = self.client.prepare(fanout=True, version='1.3')
|
||||
return cctxt.cast(ctxt, 'update_dns', network_ids=network_ids)
|
||||
cctxt.cast(ctxt, 'update_dns', network_ids=network_ids)
|
||||
|
||||
# NOTE(russellb): Ideally this would not have a prefix of '_' since it is
|
||||
# a part of the rpc API. However, this is how it was being called when the
|
||||
|
@ -113,7 +113,7 @@ class SchedulerAPI(object):
|
||||
version = '2.9'
|
||||
msg_kwargs['legacy_bdm_in_spec'] = legacy_bdm_in_spec
|
||||
cctxt = self.client.prepare(version=version)
|
||||
return cctxt.cast(ctxt, 'run_instance', **msg_kwargs)
|
||||
cctxt.cast(ctxt, 'run_instance', **msg_kwargs)
|
||||
|
||||
def prep_resize(self, ctxt, instance, instance_type, image,
|
||||
request_spec, filter_properties, reservations):
|
||||
|
@ -42,7 +42,7 @@ class NetworkRpcAPITestCase(test.NoDBTestCase):
|
||||
self.assertIsNotNone(rpcapi.client)
|
||||
self.assertEqual(rpcapi.client.target.topic, CONF.network_topic)
|
||||
|
||||
expected_retval = 'foo' if method == 'call' else None
|
||||
expected_retval = 'foo' if rpc_method == 'call' else None
|
||||
expected_version = kwargs.pop('version', None)
|
||||
expected_fanout = kwargs.pop('fanout', None)
|
||||
expected_kwargs = kwargs.copy()
|
||||
@ -86,7 +86,7 @@ class NetworkRpcAPITestCase(test.NoDBTestCase):
|
||||
rpcapi.client.prepare(**prepare_kwargs).AndReturn(rpcapi.client)
|
||||
|
||||
rpc_method = getattr(rpcapi.client, rpc_method)
|
||||
rpc_method(ctxt, method, **expected_kwargs).AndReturn(expected_retval)
|
||||
rpc_method(ctxt, method, **expected_kwargs).AndReturn('foo')
|
||||
|
||||
self.mox.ReplayAll()
|
||||
|
||||
|
@ -34,7 +34,7 @@ class SchedulerRpcAPITestCase(test.NoDBTestCase):
|
||||
self.assertIsNotNone(rpcapi.client)
|
||||
self.assertEqual(rpcapi.client.target.topic, CONF.scheduler_topic)
|
||||
|
||||
expected_retval = 'foo' if method == 'call' else None
|
||||
expected_retval = 'foo' if rpc_method == 'call' else None
|
||||
expected_version = kwargs.pop('version', None)
|
||||
expected_fanout = kwargs.pop('fanout', None)
|
||||
expected_kwargs = kwargs.copy()
|
||||
@ -54,7 +54,7 @@ class SchedulerRpcAPITestCase(test.NoDBTestCase):
|
||||
|
||||
rpc_method = getattr(rpcapi.client, rpc_method)
|
||||
|
||||
rpc_method(ctxt, method, **expected_kwargs).AndReturn(expected_retval)
|
||||
rpc_method(ctxt, method, **expected_kwargs).AndReturn('foo')
|
||||
|
||||
self.mox.ReplayAll()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user