Browse Source

rpc rehomed from neutron.common to neutron_lib.rpc

 - rehoming caused some test failures because rpc.TRANSPORT was None
 - this mocks the TRANSPORT so that tests don't fail

Change-Id: Idefeba7352e0fb9149656debf0e2f36766568987
Aditya Prakash Vaja 5 months ago
parent
commit
f504b6c545
1 changed files with 4 additions and 0 deletions
  1. 4
    0
      networking_bigswitch/tests/unit/bigswitch/test_base.py

+ 4
- 0
networking_bigswitch/tests/unit/bigswitch/test_base.py View File

@@ -51,6 +51,7 @@ KSCLIENT = 'keystoneclient.v3.client.Client'
51 51
 BACKGROUND = SERVER_MANAGER + '.ServerPool.start_background_tasks'
52 52
 MAP_TENANT_NAME = ('networking_bigswitch.plugins.bigswitch.plugin.'
53 53
                    'NeutronRestProxyV2Base._map_tenant_name')
54
+LIB_RPC_TRANSPORT = ('neutron_lib.rpc.TRANSPORT')
54 55
 
55 56
 
56 57
 class BigSwitchTestBase(object):
@@ -95,6 +96,8 @@ class BigSwitchTestBase(object):
95 96
         self.ksclient_p = mock.patch(KSCLIENT)
96 97
         self.map_tenant_name_p = mock.patch(
97 98
             MAP_TENANT_NAME, side_effect=self.map_tenant_name_side_effect)
99
+        self.lib_rpc_transport_p = mock.patch(LIB_RPC_TRANSPORT)
100
+        # start all mock patches
98 101
         self.log_exc_p.start()
99 102
         self.plugin_notifier_p.start()
100 103
         self.spawn_p.start()
@@ -102,6 +105,7 @@ class BigSwitchTestBase(object):
102 105
         self.dhcp_notifier_p.start()
103 106
         self.ksclient_p.start()
104 107
         self.map_tenant_name_p.start()
108
+        self.lib_rpc_transport_p.start()
105 109
 
106 110
     def startHttpPatch(self):
107 111
         self.httpPatch = mock.patch(HTTPCON,

Loading…
Cancel
Save