def tearDown(self): super(BaseTestCase, self).tearDown() for x in self.injected: x.stop() if FLAGS.fake_rabbit: fakerabbit.reset_all() self.tear_down()
def tearDown(self): """Runs after each test method to tear down test environment.""" try: self.mox.UnsetStubs() self.stubs.UnsetAll() self.stubs.SmartUnsetAll() self.mox.VerifyAll() super(TestCase, self).tearDown() finally: # Clean out fake_rabbit's queue if we used it if FLAGS.fake_rabbit: fakerabbit.reset_all() # Reset any overriden flags self.reset_flags() # Reset our monkey-patches rpc.Consumer.attach_to_eventlet = self.original_attach wsgi.Server.start = self.original_start # Stop any timers for x in self.injected: try: x.stop() except AssertionError: pass # Kill any services for x in self._services: try: x.kill() except Exception: pass
def tearDown(self): """Runs after each test method to finalize/tear down test environment.""" try: self.mox.UnsetStubs() self.stubs.UnsetAll() self.stubs.SmartUnsetAll() self.mox.VerifyAll() super(TestCase, self).tearDown() finally: # Clean out fake_rabbit's queue if we used it if FLAGS.fake_rabbit: fakerabbit.reset_all() # Reset any overriden flags self.reset_flags() # Reset our monkey-patches rpc.Consumer.attach_to_eventlet = self.originalAttach # Stop any timers for x in self.injected: try: x.stop() except AssertionError: pass # Kill any services for x in self._services: try: x.kill() except Exception: pass
def tearDown(self): """Runs after each test method to finalize/tear down test environment.""" try: self.mox.UnsetStubs() self.stubs.UnsetAll() self.stubs.SmartUnsetAll() self.mox.VerifyAll() # NOTE(vish): Clean up any ips associated during the test. ctxt = context.get_admin_context() db.fixed_ip_disassociate_all_by_timeout(ctxt, FLAGS.host, self.start) db.network_disassociate_all(ctxt) rpc.Consumer.attach_to_eventlet = self.originalAttach for x in self.injected: try: x.stop() except AssertionError: pass if FLAGS.fake_rabbit: fakerabbit.reset_all() db.security_group_destroy_all(ctxt) super(TestCase, self).tearDown() finally: self.reset_flags()
def tearDown(self): super(TrialTestCase, self).tearDown() self.reset_flags() self.mox.UnsetStubs() self.stubs.UnsetAll() self.stubs.SmartUnsetAll() self.mox.VerifyAll() if FLAGS.fake_rabbit: fakerabbit.reset_all()
def tearDown(self): """Runs after each test method to tear down test environment.""" try: self.mox.UnsetStubs() self.stubs.UnsetAll() self.stubs.SmartUnsetAll() self.mox.VerifyAll() super(TestCase, self).tearDown() finally: # Clean out fake_rabbit's queue if we used it if FLAGS.fake_rabbit: fakerabbit.reset_all() if FLAGS.connection_type == 'fake': if hasattr(fake.FakeConnection, '_instance'): del fake.FakeConnection._instance if FLAGS.image_service == 'nova.image.fake.FakeImageService': nova.image.fake.FakeImageService_reset() # Reset any overriden flags self.reset_flags() # Reset our monkey-patches rpc.Consumer.attach_to_eventlet = self.original_attach # Stop any timers for x in self.injected: try: x.stop() except AssertionError: pass # Kill any services for x in self._services: try: x.kill() except Exception: pass
def tearDown(self): """Runs after each test method to tear down test environment.""" try: self.mox.UnsetStubs() self.stubs.UnsetAll() self.stubs.SmartUnsetAll() self.mox.VerifyAll() super(TestCase, self).tearDown() finally: # Clean out fake_rabbit's queue if we used it if FLAGS.fake_rabbit: fakerabbit.reset_all() if FLAGS.connection_type == 'fake': if hasattr(fake.FakeConnection, '_instance'): del fake.FakeConnection._instance if FLAGS.image_service == 'nova.image.fake.FakeImageService': nova.image.fake.FakeImageService_reset() # Reset any overriden flags self.reset_flags() # Stop any timers for x in self.injected: try: x.stop() except AssertionError: pass # Kill any services for x in self._services: try: x.kill() except Exception: pass