summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authortermie <github@anarkystic.com>2011-05-25 15:42:24 -0700
committertermie <github@anarkystic.com>2011-05-25 15:42:24 -0700
commit51e8eeb9b3a23f811bcbf52d9700d94c5c8b15e4 (patch)
tree57264d10f16be215ce309cbecce04d478e9c7b49 /nova/tests
parentb193b97054f11664a72cd53547f355d1c9044f88 (diff)
bring back commits lost in merge
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/test_rpc.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/nova/tests/test_rpc.py b/nova/tests/test_rpc.py
index f64209596..e5d99474d 100644
--- a/nova/tests/test_rpc.py
+++ b/nova/tests/test_rpc.py
@@ -61,6 +61,18 @@ class RpcTestCase(test.TestCase):
self.assertEqual(value + i, x)
i += 1
+ def test_multicall_succeed_three_times_yield(self):
+ """Get a value through rpc call"""
+ value = 42
+ result = rpc.multicall(self.context,
+ 'test',
+ {"method": "echo_three_times_yield",
+ "args": {"value": value}})
+ i = 0
+ for x in result:
+ self.assertEqual(value + i, x)
+ i += 1
+
def test_context_passed(self):
"""Makes sure a context is passed through rpc call"""
value = 42
@@ -83,6 +95,7 @@ class RpcTestCase(test.TestCase):
'test',
{"method": "fail",
"args": {"value": value}})
+ LOG.error('INNNNNNN BETTTWWWWWWWWWWEEEEEEEEEEN')
try:
rpc.call(self.context,
'test',
@@ -187,6 +200,12 @@ class TestReceiver(object):
context.reply(value + 2)
@staticmethod
+ def echo_three_times_yield(context, value):
+ yield value
+ yield value + 1
+ yield value + 2
+
+ @staticmethod
def fail(context, value):
"""Raises an exception with the value sent in"""
raise Exception(value)