From 8191085db1dd36a7a860b722601504b1438c8be5 Mon Sep 17 00:00:00 2001 From: Roey Chen Date: Tue, 19 Apr 2016 01:03:15 -0700 Subject: [PATCH] NSXv: mock spawn_n when runnign unittests Change-Id: I567af1838f8e801444caefe41c3adb26635dabf8 --- vmware_nsx/tests/unit/nsx_v/test_plugin.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vmware_nsx/tests/unit/nsx_v/test_plugin.py b/vmware_nsx/tests/unit/nsx_v/test_plugin.py index 77569c0777..3309ac3b6b 100644 --- a/vmware_nsx/tests/unit/nsx_v/test_plugin.py +++ b/vmware_nsx/tests/unit/nsx_v/test_plugin.py @@ -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()