From: Kevin Benton Date: Sat, 21 Mar 2015 00:40:43 +0000 (-0700) Subject: Add no_delete flag to UT router context manager X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=c3018d35f1d903ccf8d08d04c5e4b9e2fca0b68b;p=openstack-build%2Fneutron-build.git 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 --- 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,