From a224d7048068330fb62624c2d2a542d0ad30d8dc Mon Sep 17 00:00:00 2001 From: Mark McLoughlin Date: Fri, 20 Jul 2012 17:04:54 +0100 Subject: Use BaseTestCase for all tests which override config Fixes bug #1027120 We already have nice helper methods for overriding config and cleaning up the overrides, so let's use them. Change-Id: Ibd501743d1c4ec21cb2b0d22382cb681ee5768ed --- tests/unit/rpc/test_kombu.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'tests/unit/rpc/test_kombu.py') diff --git a/tests/unit/rpc/test_kombu.py b/tests/unit/rpc/test_kombu.py index e280e1e..2cdca15 100644 --- a/tests/unit/rpc/test_kombu.py +++ b/tests/unit/rpc/test_kombu.py @@ -68,8 +68,8 @@ class RpcKombuTestCase(common.BaseRpcAMQPTestCase): def setUp(self): self.stubs = stubout.StubOutForTesting() if kombu: - FLAGS.set_override('fake_rabbit', True) - FLAGS.set_override('rpc_response_timeout', 5) + self.config(fake_rabbit=True) + self.config(rpc_response_timeout=5) self.rpc = impl_kombu else: self.rpc = None @@ -80,7 +80,6 @@ class RpcKombuTestCase(common.BaseRpcAMQPTestCase): self.stubs.SmartUnsetAll() if kombu: impl_kombu.cleanup() - FLAGS.reset() super(RpcKombuTestCase, self).tearDown() @testutils.skip_if(kombu is None, "Test requires kombu") @@ -365,7 +364,7 @@ class RpcKombuTestCase(common.BaseRpcAMQPTestCase): exception is converted to a string. """ - FLAGS.set_override('allowed_rpc_exception_modules', ['exceptions']) + self.config(allowed_rpc_exception_modules=['exceptions']) value = "This is the exception message" self.assertRaises(NotImplementedError, self.rpc.call, @@ -385,8 +384,6 @@ class RpcKombuTestCase(common.BaseRpcAMQPTestCase): #Traceback should be included in exception message self.assertTrue('raise NotImplementedError(value)' in unicode(exc)) - FLAGS.reset() - @testutils.skip_if(kombu is None, "Test requires kombu") def test_call_converted_exception(self): """Test that exception gets passed back properly. -- cgit