This commit is contained in:
Ask Solem 2011-03-28 17:06:44 +02:00
parent 1a09b41d19
commit 8a11832a07
2 changed files with 10 additions and 8 deletions

View File

@ -48,9 +48,9 @@ class BrokerConnection(object):
``amqplib``, ``pika``, ``redis``, ``memory``.
:keyword connect_timeout: Timeout in seconds for connecting to the
server. May not be suported by the specified transport.
:keyword transport_options: A dict of additional connection arguments to pass to
alternate kombu channel implementations (useful for things like SQLAlchemy
engine arguments)
:keyword transport_options: A dict of additional connection arguments to
pass to alternate kombu channel implementations. Consult the transport
documentation for available options.
**Usage**
@ -81,7 +81,8 @@ class BrokerConnection(object):
def __init__(self, hostname="localhost", userid="guest",
password="guest", virtual_host="/", port=None, insist=False,
ssl=False, transport=None, connect_timeout=5, backend_cls=None, transport_options={}):
ssl=False, transport=None, connect_timeout=5, backend_cls=None,
transport_options={}, **kwargs):
self.hostname = hostname
self.userid = userid
self.password = password

View File

@ -22,7 +22,7 @@ class test_Connection(unittest.TestCase):
_connection = conn.connection
conn.close()
self.assertFalse(_connection.connected)
self.assertIsInstance(conn.transport, Transport)
self.assertIsInstance(conn.transport, Transport)
def test__enter____exit__(self):
conn = self.conn
@ -100,12 +100,13 @@ class test_Connection(unittest.TestCase):
class test_Connection_With_Broker_Args(unittest.TestCase):
_extra_args = {
'pool_recycle' : 3600,
'echo' : True
'pool_recycle': 3600,
'echo': True
}
def setUp(self):
self.conn = BrokerConnection(port=5672, transport=Transport, transport_options=self._extra_args)
self.conn = BrokerConnection(port=5672, transport=Transport,
transport_options=self._extra_args)
def test_establish_connection(self):
conn = self.conn