diff options
author | Mark McLoughlin <markmc@redhat.com> | 2012-07-20 17:04:54 +0100 |
---|---|---|
committer | Mark McLoughlin <markmc@redhat.com> | 2012-07-20 17:05:43 +0100 |
commit | a224d7048068330fb62624c2d2a542d0ad30d8dc (patch) | |
tree | 2c79eb4ba888c91592cc03c123d1b208ae7ddfb8 /tests/unit/rpc/test_kombu.py | |
parent | a852c832e4576e69eb3b15a5989375c79a3aac46 (diff) | |
download | oslo-a224d7048068330fb62624c2d2a542d0ad30d8dc.tar.gz oslo-a224d7048068330fb62624c2d2a542d0ad30d8dc.tar.xz oslo-a224d7048068330fb62624c2d2a542d0ad30d8dc.zip |
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
Diffstat (limited to 'tests/unit/rpc/test_kombu.py')
-rw-r--r-- | tests/unit/rpc/test_kombu.py | 9 |
1 files changed, 3 insertions, 6 deletions
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. |