summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Lyons <scottalyons@gmail.com>2012-02-03 22:59:47 -0500
committerScott Lyons <scottalyons@gmail.com>2012-02-03 22:59:47 -0500
commit26fedee24063fb8a2adeecc912c3a53a0b5b1198 (patch)
tree7e843c5605f0a49be24b450aee935e5ede3f6b88
parent2b140266c5eaed0d53445867732b64bbafdb35e4 (diff)
downloadkombu-26fedee24063fb8a2adeecc912c3a53a0b5b1198.tar.gz
Fixing up the MongoDB tests from their moving to the funtests module. Fixes a few typos as well.
-rw-r--r--funtests/tests/test_mongodb.py12
-rw-r--r--kombu/transport/mongodb.py4
2 files changed, 8 insertions, 8 deletions
diff --git a/funtests/tests/test_mongodb.py b/funtests/tests/test_mongodb.py
index 83932364..c51e3a5a 100644
--- a/funtests/tests/test_mongodb.py
+++ b/funtests/tests/test_mongodb.py
@@ -16,14 +16,14 @@ class test_mongodb(transport.TransportCase):
def test_fanout(self, name="test_mongodb_fanout"):
c = self.connection
- e = Exchange(name, type="fanout")
- q = Queue(name, exchange=e, routing_key=name)
- q2 = Queue(name + "2", exchange=e, routing_key=name + "2")
+ self.e = Exchange(name, type="fanout")
+ self.q = Queue(name, exchange=self.e, routing_key=name)
+ self.q2 = Queue(name + "2", exchange=self.e, routing_key=name + "2")
channel = c.default_channel
- producer = Producer(channel, e)
- consumer1 = Consumer(channel, q)
- consumer2 = Consumer(channel, q2)
+ producer = Producer(channel, self.e)
+ consumer1 = Consumer(channel, self.q)
+ consumer2 = Consumer(channel, self.q2)
self.q2(channel).declare()
for i in xrange(10):
diff --git a/kombu/transport/mongodb.py b/kombu/transport/mongodb.py
index 367068a0..71c2b6b5 100644
--- a/kombu/transport/mongodb.py
+++ b/kombu/transport/mongodb.py
@@ -28,7 +28,6 @@ Flavio [FlaPer87] Percoco Premoli <flaper87@flaper87.org>;\
Scott Lyons <scottalyons@gmail.com>;\
"""
-
class Channel(virtual.Channel):
_client = None
supports_fanout = True
@@ -90,7 +89,7 @@ class Channel(virtual.Channel):
def close(self):
super(Channel, self).close()
if self._client:
- self._client.database.connection.end_request()
+ self._client.connection.end_request()
def _open(self):
conninfo = self.connection.client
@@ -124,6 +123,7 @@ class Channel(virtual.Channel):
self.routing.ensure_index([("queue", 1), ("exchange", 1)])
return database
+ #TODO: Store a more complete exchange metatable in the routing collection
def get_table(self, exchange):
"""Get table of bindings for ``exchange``."""
brokerRoutes = self.client.messages.routing.find({