summaryrefslogtreecommitdiffstats
path: root/tests/unit/rpc
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/rpc')
-rw-r--r--tests/unit/rpc/matchmaker_common.py13
-rw-r--r--tests/unit/rpc/test_common.py3
-rw-r--r--tests/unit/rpc/test_matchmaker_redis.py21
-rw-r--r--tests/unit/rpc/test_qpid.py12
-rw-r--r--tests/unit/rpc/test_zmq.py12
5 files changed, 24 insertions, 37 deletions
diff --git a/tests/unit/rpc/matchmaker_common.py b/tests/unit/rpc/matchmaker_common.py
index 154162d..490c329 100644
--- a/tests/unit/rpc/matchmaker_common.py
+++ b/tests/unit/rpc/matchmaker_common.py
@@ -50,20 +50,17 @@ class _MatchMakerTestCase(_MatchMakerDirectedTopicTestCase):
class _MatchMakerDynRegTestCase(object):
def test_registers_host(self):
- """
- Registers a host, ensures it is registered.
- """
+ """Registers a host, ensures it is registered."""
self.driver.register(self.topic, self.hosts[0])
match = self.driver.queues(self.topic)
self.assertEqual(match[0][1], self.hosts[0])
def test_unregister(self):
- """
- Tests that hosts unregister cleanly.
- Registers a host, ensures it is registered,
- then unregisters and ensures is no
- longer registered.
+ """Tests that hosts unregister cleanly.
+
+ Registers a host, ensures it is registered, then unregisters and
+ ensures is no longer registered.
"""
# Can only unregister if registrations work.
self.test_registers_host()
diff --git a/tests/unit/rpc/test_common.py b/tests/unit/rpc/test_common.py
index 73ca63b..471048c 100644
--- a/tests/unit/rpc/test_common.py
+++ b/tests/unit/rpc/test_common.py
@@ -144,7 +144,8 @@ class RpcCommonTestCase(test_utils.BaseTestCase):
six.text_type(after_exc))
def test_deserialize_remote_exception_args_and_kwargs(self):
- """
+ """Test user exception deserialization.
+
Ensure a user defined exception will be supplied the correct args and
kwargs while being deserialized.
"""
diff --git a/tests/unit/rpc/test_matchmaker_redis.py b/tests/unit/rpc/test_matchmaker_redis.py
index a1eb0a0..446908a 100644
--- a/tests/unit/rpc/test_matchmaker_redis.py
+++ b/tests/unit/rpc/test_matchmaker_redis.py
@@ -95,20 +95,17 @@ class MatchMakerRedisHeartbeatTestCase(utils.BaseTestCase,
self.driver.unregister(self.topic, host)
def test_expires_set(self):
- """
- Test that expirations are set.
- """
+ """Test that expirations are set."""
self.driver.register(self.topic, self.hosts[0])
ttl = self.driver.redis.ttl('.'.join((self.topic, self.hosts[0])))
self.assertTrue(ttl > -1)
def test_expires_hosts(self):
- """
- Tests that hosts expire.
- Registers a host, ensures it is registered,
- then waits for it to expire. Ensures is no
- longer registered.
+ """Tests that hosts expire.
+
+ Registers a host, ensures it is registered, then waits for it to
+ expire. Ensures is no longer registered.
"""
self.driver.register(self.topic, self.hosts[0])
@@ -122,9 +119,7 @@ class MatchMakerRedisHeartbeatTestCase(utils.BaseTestCase,
self.assertEqual(ttl2, -1)
def test_expired_hosts_removed(self):
- """
- Test that expired hosts are removed from results.
- """
+ """Test that expired hosts are removed from results."""
self.test_expires_hosts()
self.assertEqual(self.driver.queues(self.topic), [])
@@ -132,9 +127,7 @@ class MatchMakerRedisHeartbeatTestCase(utils.BaseTestCase,
class MatchMakerRedisTestCase(utils.BaseTestCase):
"""Generic tests that do not require a Redis server."""
def test_redis_import_exception(self):
- """
- Try initializing an object without redis.
- """
+ """Try initializing an object without redis."""
matchmaker.redis = None
self.assertRaises(ImportError, matchmaker.MatchMakerRedis)
reload(matchmaker)
diff --git a/tests/unit/rpc/test_qpid.py b/tests/unit/rpc/test_qpid.py
index 02e8e20..42a6e6b 100644
--- a/tests/unit/rpc/test_qpid.py
+++ b/tests/unit/rpc/test_qpid.py
@@ -45,8 +45,7 @@ FLAGS = cfg.CONF
class RpcQpidTestCase(utils.BaseTestCase):
- """
- Exercise the public API of impl_qpid utilizing mox.
+ """Exercise the public API of impl_qpid utilizing mox.
This set of tests utilizes mox to replace the Qpid objects and ensures
that the right operations happen on them when the various public rpc API
@@ -479,10 +478,11 @@ class RpcQpidTestCase(utils.BaseTestCase):
impl_qpid.Connection.pool.get()
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
- to a TTL. A string test that actually involved qpid would be
- excellent, but this at least verifies that the exceptions flow
+ """A little more indepth for a timeout test.
+
+ Specifically we are looking to simulate the event sent to qpid dying
+ on the vine due to a TTL. A string test that actually involved qpid
+ would be excellent, but this at least verifies that the exceptions flow
like they should. TODO(beagles): is this really necessary or is
the the case for qpid at least the basic timeout test is
sufficient.
diff --git a/tests/unit/rpc/test_zmq.py b/tests/unit/rpc/test_zmq.py
index 564f15e..b0f0262 100644
--- a/tests/unit/rpc/test_zmq.py
+++ b/tests/unit/rpc/test_zmq.py
@@ -42,9 +42,7 @@ FLAGS = cfg.CONF
def get_unused_port():
- """
- Returns an unused port on localhost.
- """
+ """Returns an unused port on localhost."""
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(('localhost', 0))
addr, port = s.getsockname()
@@ -117,7 +115,8 @@ class _RpcZmqBaseTestCase(common.BaseRpcTestCase):
class RpcZmqBaseTopicTestCase(_RpcZmqBaseTestCase):
- """
+ """Base topic RPC ZMQ test case.
+
This tests with topics such as 'test' and 'nested',
without any .host appended. Stresses the matchmaker.
"""
@@ -125,10 +124,7 @@ class RpcZmqBaseTopicTestCase(_RpcZmqBaseTestCase):
class RpcZmqDirectTopicTestCase(_RpcZmqBaseTestCase):
- """
- Test communication directly to a host,
- tests use 'localhost'.
- """
+ """Test communication directly to a host, tests use 'localhost'."""
def setUp(self):
super(RpcZmqDirectTopicTestCase, self).setUp(
topic='test.127.0.0.1',