summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/test_rpc.py12
-rw-r--r--nova/tests/test_service.py6
2 files changed, 7 insertions, 11 deletions
diff --git a/nova/tests/test_rpc.py b/nova/tests/test_rpc.py
index 35f4a64d9..ffd748efe 100644
--- a/nova/tests/test_rpc.py
+++ b/nova/tests/test_rpc.py
@@ -66,12 +66,10 @@ class RpcTestCase(test.TestCase):
'test',
{"method": "echo",
"args": {"value": value}})
- i = 0
- for x in result:
+ for i, x in enumerate(result):
if i > 0:
self.fail('should only receive one response')
self.assertEqual(value + i, x)
- i += 1
def test_multicall_succeed_three_times(self):
value = 42
@@ -79,10 +77,8 @@ class RpcTestCase(test.TestCase):
'test',
{"method": "echo_three_times",
"args": {"value": value}})
- i = 0
- for x in result:
+ for i, x in enumerate(result):
self.assertEqual(value + i, x)
- i += 1
def test_multicall_succeed_three_times_yield(self):
value = 42
@@ -90,10 +86,8 @@ class RpcTestCase(test.TestCase):
'test',
{"method": "echo_three_times_yield",
"args": {"value": value}})
- i = 0
- for x in result:
+ for i, x in enumerate(result):
self.assertEqual(value + i, x)
- i += 1
def test_context_passed(self):
"""Makes sure a context is passed through rpc call."""
diff --git a/nova/tests/test_service.py b/nova/tests/test_service.py
index 0bba01d92..d1cc8bd61 100644
--- a/nova/tests/test_service.py
+++ b/nova/tests/test_service.py
@@ -142,7 +142,8 @@ class ServiceTestCase(test.TestCase):
mock_cset = self.mox.CreateMock(rpc.ConsumerSet,
{'wait': wait_func})
- rpc.ConsumerSet(mox.IgnoreArg(), mox.IsA(list)).AndReturn(mock_cset)
+ rpc.ConsumerSet(connection=mox.IgnoreArg(),
+ consumer_list=mox.IsA(list)).AndReturn(mock_cset)
wait_func(mox.IgnoreArg())
service_create = {'host': host,
@@ -331,7 +332,8 @@ class ServiceTestCase(test.TestCase):
mock_cset = self.mox.CreateMock(rpc.ConsumerSet,
{'wait': wait_func})
- rpc.ConsumerSet(mox.IgnoreArg(), mox.IsA(list)).AndReturn(mock_cset)
+ rpc.ConsumerSet(connection=mox.IgnoreArg(),
+ consumer_list=mox.IsA(list)).AndReturn(mock_cset)
wait_func(mox.IgnoreArg())
self.mox.StubOutWithMock(serv.manager.driver,