Stops the default HTTPConnection patch used by the
Big Switch tests before patching HTTPConnection with
another substitution. This prevents mock from losing
track of the default patch which was resulting in it
not consistently being stopped by the stopall call in
cleanup.
This also corrects an incorrectly targeted mock for the
HTTP patch in one of the test files.
Closes-Bug: #
1303605
Change-Id: Ia5b374c5f8d3a7905d915de4f1f8d4f3a6f0e58d
# perform a task to cause capabilities to be retrieved
with self.floatingip_with_assoc():
pass
+ # stop default HTTP patch since we need a magicmock
+ self.httpPatch.stop()
# now mock HTTP class instead of REST so we can see headers
conmock = mock.patch(HTTPCON).start()
instance = conmock.return_value
from neutron.tests.unit import test_l3_plugin
-HTTPCON = 'neutron.plugins.bigswitch.servermanager.httplib.HTTPConnection'
+HTTPCON = 'neutron.plugins.bigswitch.servermanager.HTTPConnection'
_uuid = uuidutils.generate_uuid
net_id=psub['subnet']['network_id'],
port_id=p1['port']['id'],
tenant_id=tenant1_id)
+ self.httpPatch.stop()
multiFloatPatch = patch(
HTTPCON,
new=fake_server.VerifyMultiTenantFloatingIP)
port_id=p2['port']['id'],
tenant_id=tenant2_id)
multiFloatPatch.stop()
+ self.httpPatch.start()
self._delete('floatingips', fl1['floatingip']['id'])
self._delete('floatingips', fl2['floatingip']['id'])
self._router_interface_action(