UT: Fix "RuntimeError: stop called on unstarted patcher"

By removing explicit addCleanup calls.
and also change import '_' from neutronclient.i18n import _
to networking_l2gw._i18n import _.

Change-Id: I2001c0d0b00410188942c02f7b8b43d3d2fd5b22
Closes-Bug: 1608389
changes/73/349373/4
vikas 7 years ago
parent 96edbeed52
commit ee7bf467d1

@ -16,9 +16,10 @@
from neutronclient.common import extension
from neutronclient.common import utils
from neutronclient.i18n import _
from oslo_serialization import jsonutils
from networking_l2gw._i18n import _
INTERFACE_DELIMITER = ";"
SEGMENTATION_ID_DELIMITER = "#"
INTERFACE_SEG_ID_DELIMITER = "|"

@ -15,9 +15,10 @@
#
from neutronclient.common import extension
from neutronclient.i18n import _
from neutronclient.neutron import v2_0 as l2gatewayV20
from networking_l2gw._i18n import _
class L2GatewayConnection(extension.NeutronClientExtension):
resource = 'l2_gateway_connection'

@ -34,7 +34,6 @@ class CLITestV20ExtensionL2GWJSON(test_cli20.CLITestV20Base):
def _create_patch(self, name, func=None):
patcher = mock.patch(name)
thing = patcher.start()
self.addCleanup(patcher.stop)
return thing
def _mock_extension_loading(self):

@ -34,7 +34,6 @@ class CLITestV20ExtensionL2GWJSON(test_cli20.CLITestV20Base):
def _create_patch(self, name, func=None):
patcher = mock.patch(name)
thing = patcher.start()
self.addCleanup(patcher.stop)
return thing
def _mock_extension_loading(self):

Loading…
Cancel
Save