From c3018d35f1d903ccf8d08d04c5e4b9e2fca0b68b Mon Sep 17 00:00:00 2001 From: Kevin Benton Date: Fri, 20 Mar 2015 17:40:43 -0700 Subject: [PATCH] Add no_delete flag to UT router context manager Adds a no_delete flag to the router context manager in the unit tests to allow specific tests to avoid executing all of the cleanup logic for floating IPs and interfaces just to exit the test. Ultimately, this should become the default once we are comfortable that there is adequate explicit unit tests for the deletion logic. Change-Id: Iecbcc77b67b440d726fa6e703a87884e0b0df321 --- neutron/tests/unit/test_l3_plugin.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/neutron/tests/unit/test_l3_plugin.py b/neutron/tests/unit/test_l3_plugin.py index 7bf9e6f10..56cba4177 100644 --- a/neutron/tests/unit/test_l3_plugin.py +++ b/neutron/tests/unit/test_l3_plugin.py @@ -409,12 +409,14 @@ class L3NatTestCaseMixin(object): def router(self, name='router1', admin_state_up=True, fmt=None, tenant_id=_uuid(), external_gateway_info=None, set_context=False, + no_delete=False, **kwargs): router = self._make_router(fmt or self.fmt, tenant_id, name, admin_state_up, external_gateway_info, set_context, **kwargs) yield router - self._delete('routers', router['router']['id']) + if not no_delete: + self._delete('routers', router['router']['id']) def _set_net_external(self, net_id): self._update('networks', net_id, -- 2.45.2