NSXv: mock spawn_n when runnign unittests

Change-Id: I567af1838f8e801444caefe41c3adb26635dabf8
This commit is contained in:
Roey Chen 2016-04-19 01:03:15 -07:00
parent f5c2ebce1a
commit 8191085db1

View File

@ -48,6 +48,7 @@ import webob.exc
from vmware_nsx._i18n import _
from vmware_nsx.common import exceptions as nsxv_exc
from vmware_nsx.common import nsx_constants
from vmware_nsx.common import utils as c_utils
from vmware_nsx.db import nsxv_db
from vmware_nsx.dvs import dvs
from vmware_nsx.dvs import dvs_utils
@ -2894,6 +2895,7 @@ class NsxVSecurityGroupsTestCase(ext_sg.SecurityGroupDBTestCase):
mock_delete_dhcp_service = mock.patch("%s.%s" % (
vmware.EDGE_MANAGE_NAME, 'delete_dhcp_edge_service'))
mock_delete_dhcp_service.start()
c_utils.spawn_n = mock.Mock(side_effect=lambda f: f())
super(NsxVSecurityGroupsTestCase, self).setUp(plugin=plugin,
ext_mgr=ext_mgr)
self.plugin = manager.NeutronManager.get_plugin()