示例#1
0
文件: test.py 项目: bopopescu/cc
 def tearDown(self):
     super(BaseTestCase, self).tearDown()
     for x in self.injected:
         x.stop()
     if FLAGS.fake_rabbit:
         fakerabbit.reset_all()
     self.tear_down()
示例#2
0
文件: test.py 项目: termie/pupa
    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
示例#3
0
 def tearDown(self):
     super(BaseTestCase, self).tearDown()
     for x in self.injected:
         x.stop()
     if FLAGS.fake_rabbit:
         fakerabbit.reset_all()
     self.tear_down()
示例#4
0
文件: test.py 项目: pombredanne/nova
    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
示例#5
0
文件: test.py 项目: anotherjesse/nova
    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()
示例#6
0
    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()
示例#7
0
文件: test.py 项目: bopopescu/cc
    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()
示例#8
0
    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
示例#9
0
文件: test.py 项目: termie/nova
    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