summaryrefslogtreecommitdiffstats
path: root/nova/test.py
diff options
context:
space:
mode:
authorZed Shaw <zedshaw@zedshaw.com>2011-07-29 19:34:18 +0000
committerTarmac <>2011-07-29 19:34:18 +0000
commitbbfd483a5cb720eeee97787b10210129b5e4b38e (patch)
treee0c8c5c7e6fbc4c8dea08f2f119b79c6cb5db59c /nova/test.py
parentc4d7127367ff4b34f11355e04e1f26fd414f459c (diff)
parent99459b56fdd3cca269be39b96beab71ef10af25e (diff)
downloadnova-bbfd483a5cb720eeee97787b10210129b5e4b38e.tar.gz
nova-bbfd483a5cb720eeee97787b10210129b5e4b38e.tar.xz
nova-bbfd483a5cb720eeee97787b10210129b5e4b38e.zip
This change creates a minimalist API abstraction for the nova/rpc.py code so that it's possible to use other queue mechanisms besides Rabbit and/or AMQP, and even use other drivers for AMQP rather than Rabbit. The change is intended to give the least amount of interference with the rest of the code, fixes several bugs in the tests, and works with the current branch. I also have a small demo driver+server for using 0MQ which I'll submit after this patch is merged.
Diffstat (limited to 'nova/test.py')
-rw-r--r--nova/test.py16
1 files changed, 0 insertions, 16 deletions
diff --git a/nova/test.py b/nova/test.py
index 9790b0aa1..549aa6fcf 100644
--- a/nova/test.py
+++ b/nova/test.py
@@ -99,9 +99,7 @@ class TestCase(unittest.TestCase):
self.flag_overrides = {}
self.injected = []
self._services = []
- self._monkey_patch_attach()
self._original_flags = FLAGS.FlagValuesDict()
- rpc.ConnectionPool = rpc.Pool(max_size=FLAGS.rpc_conn_pool_size)
def tearDown(self):
"""Runs after each test method to tear down test environment."""
@@ -126,9 +124,6 @@ class TestCase(unittest.TestCase):
# Reset any overriden flags
self.reset_flags()
- # Reset our monkey-patches
- rpc.Consumer.attach_to_eventlet = self.original_attach
-
# Stop any timers
for x in self.injected:
try:
@@ -172,17 +167,6 @@ class TestCase(unittest.TestCase):
self._services.append(svc)
return svc
- def _monkey_patch_attach(self):
- self.original_attach = rpc.Consumer.attach_to_eventlet
-
- def _wrapped(inner_self):
- rv = self.original_attach(inner_self)
- self.injected.append(rv)
- return rv
-
- _wrapped.func_name = self.original_attach.func_name
- rpc.Consumer.attach_to_eventlet = _wrapped
-
# Useful assertions
def assertDictMatch(self, d1, d2, approx_equal=False, tolerance=0.001):
"""Assert two dicts are equivalent.