diff options
author | Monty Taylor <mordred@inaugust.com> | 2013-03-19 20:15:59 -0700 |
---|---|---|
committer | Monty Taylor <mordred@inaugust.com> | 2013-03-24 16:36:56 +0100 |
commit | 14a75981b2c4d646b63be333024f98cf9db368a2 (patch) | |
tree | cc1c719c0e39b21d217f20b9f3baca17604fb7aa /tests/unit/rpc | |
parent | 329b8dd639e4f65369547f96f0ad841bb2fdf113 (diff) | |
download | oslo-14a75981b2c4d646b63be333024f98cf9db368a2.tar.gz oslo-14a75981b2c4d646b63be333024f98cf9db368a2.tar.xz oslo-14a75981b2c4d646b63be333024f98cf9db368a2.zip |
Update to use flake8.
flake8 is pluggable and handles pep8 and pyflakes, as well as configuration
through tox.ini. It also removes the need for flakes.py.
Change-Id: If5f7d8ad348b4fb8119fa4ec7b5e9d17bdc72a39
Diffstat (limited to 'tests/unit/rpc')
-rw-r--r-- | tests/unit/rpc/amqp.py | 4 | ||||
-rw-r--r-- | tests/unit/rpc/test_common.py | 5 | ||||
-rw-r--r-- | tests/unit/rpc/test_kombu.py | 6 | ||||
-rw-r--r-- | tests/unit/rpc/test_proxy.py | 1 | ||||
-rw-r--r-- | tests/unit/rpc/test_qpid.py | 3 | ||||
-rw-r--r-- | tests/unit/rpc/test_zmq.py | 1 |
6 files changed, 7 insertions, 13 deletions
diff --git a/tests/unit/rpc/amqp.py b/tests/unit/rpc/amqp.py index d8a3570..64a61f3 100644 --- a/tests/unit/rpc/amqp.py +++ b/tests/unit/rpc/amqp.py @@ -47,7 +47,7 @@ class BaseRpcAMQPTestCase(common.BaseRpcTestCase): def fake_unpack_context(*args, **kwargs): info['unpacked'] = True - raise test.TestingException('moo') + raise Exception('moo') self.stubs.Set(rpc_amqp, 'unpack_context', fake_unpack_context) @@ -144,7 +144,7 @@ class BaseRpcAMQPTestCase(common.BaseRpcTestCase): FLAGS, self.context, self.topic, {"method": "echo", "args": {"value": value}}, timeout=1) - except rpc_common.Timeout as exc: + except rpc_common.Timeout: # expect a timeout in this case if single_reply_queue_for_callee_off: result = 42 diff --git a/tests/unit/rpc/test_common.py b/tests/unit/rpc/test_common.py index ee7bc96..cb7e35d 100644 --- a/tests/unit/rpc/test_common.py +++ b/tests/unit/rpc/test_common.py @@ -53,7 +53,7 @@ class RpcCommonTestCase(test_utils.BaseTestCase): try: raise_exception() - except Exception as exc: + except Exception: failure = rpc_common.serialize_remote_exception(sys.exc_info()) failure = jsonutils.loads(failure) @@ -74,7 +74,7 @@ class RpcCommonTestCase(test_utils.BaseTestCase): try: raise_custom_exception() - except Exception as exc: + except Exception: failure = rpc_common.serialize_remote_exception(sys.exc_info()) failure = jsonutils.loads(failure) @@ -218,7 +218,6 @@ class RpcCommonTestCase(test_utils.BaseTestCase): def naughty(): raise FooException() - e = None self.assertRaises(FooException, rpc_common.catch_client_exception, [ValueError], naughty) diff --git a/tests/unit/rpc/test_kombu.py b/tests/unit/rpc/test_kombu.py index cb49169..ae07bed 100644 --- a/tests/unit/rpc/test_kombu.py +++ b/tests/unit/rpc/test_kombu.py @@ -434,8 +434,8 @@ class RpcKombuTestCase(amqp.BaseRpcAMQPTestCase): conn.declare_direct_consumer('a_direct', _callback) conn.direct_send('a_direct', rpc_common.serialize_msg(message)) - info = _raise_exc_stub(self.stubs, 1, conn.connection, - 'drain_events', 'foo timeout foo') + _raise_exc_stub(self.stubs, 1, conn.connection, + 'drain_events', 'foo timeout foo') conn.consume(limit=1) conn.close() @@ -591,7 +591,7 @@ class RpcKombuHATestCase(utils.BaseTestCase): self.stubs.Set(kombu.connection, 'BrokerConnection', MyConnection) - conn = self.rpc.Connection(FLAGS) + self.rpc.Connection(FLAGS) self.assertEqual(info['attempt'], 5) diff --git a/tests/unit/rpc/test_proxy.py b/tests/unit/rpc/test_proxy.py index 5ac4cea..97bb9d5 100644 --- a/tests/unit/rpc/test_proxy.py +++ b/tests/unit/rpc/test_proxy.py @@ -33,7 +33,6 @@ class RpcProxyTestCase(utils.BaseTestCase): def _test_rpc_method(self, rpc_method, has_timeout=False, has_retval=False, server_params=None, supports_topic_override=True): topic = 'fake_topic' - timeout = None rpc_proxy = proxy.RpcProxy(topic, '1.0') ctxt = context.RequestContext('fake_user', 'fake_project') msg = {'method': 'fake_method', 'args': {'x': 'y'}} diff --git a/tests/unit/rpc/test_qpid.py b/tests/unit/rpc/test_qpid.py index e119793..0ee05cf 100644 --- a/tests/unit/rpc/test_qpid.py +++ b/tests/unit/rpc/test_qpid.py @@ -478,9 +478,6 @@ class RpcQpidTestCase(utils.BaseTestCase): # that it doesn't mess up other test cases. impl_qpid.Connection.pool.get() - def test_call(self): - self._test_call(multi=False) - def test_call_with_timeout(self): """A little more indepth for a timeout test. Specifically we are looking to simulate the event sent to qpid dying on the vine due diff --git a/tests/unit/rpc/test_zmq.py b/tests/unit/rpc/test_zmq.py index 5380a98..21345a9 100644 --- a/tests/unit/rpc/test_zmq.py +++ b/tests/unit/rpc/test_zmq.py @@ -30,7 +30,6 @@ import fixtures from oslo.config import cfg from openstack.common.gettextutils import _ -from openstack.common.rpc import common as rpc_common from tests.unit.rpc import common try: |