Fixed a error in test_create_tenant_rpc

In the latest version of oslo_messaing/server.py, an error has occurred
such as the following.

     File "/opt/stack/networking-nec-newton-fix-errors/.tox/py27/local/lib/python2.7/site-packages/oslo_messaging/server.py", line 348, in __init__
        super(MessageHandlingServer, self).__init__()
    TypeError: must be type, not MagicMock

Then, the mock patch of MessageHandlingServer was changed to ServiceBase
which is a parent class of MessageHandlingServer.

Change-Id: Ib8ef818aea5a7c64e3177866d2895da91e5de2bb
This commit is contained in:
Shinji YANAGIDA 2016-05-19 04:19:09 +09:00
parent 7b5ea79cc5
commit 9fec80e7d2
1 changed files with 2 additions and 2 deletions

View File

@ -22,7 +22,7 @@ from networking_nec.tests.unit.nwa.agent import base
class TestAgentServerManager(base.TestNWAAgentBase):
@mock.patch('oslo_messaging.server.MessageHandlingServer')
@mock.patch('oslo_messaging.server.service.ServiceBase')
def test_create_tenant_rpc_server(self, f1):
tenant_id = '844eb55f21e84a289e9c22098d387e5d'
rd = self.agent.server_manager.create_tenant_rpc_server(tenant_id)
@ -36,7 +36,7 @@ class TestAgentServerManager(base.TestNWAAgentBase):
eventlet.sleep(5)
return Server()
@mock.patch('oslo_messaging.server.MessageHandlingServer')
@mock.patch('oslo_messaging.server.service.ServiceBase')
def test_create_tenant_rpc_server_greenpool_resize(self, mhs):
poolsize = 3
manager = server_manager.ServerManager(self.agent.topic, self.agent,