mirror of https://github.com/celery/kombu.git
PEP8ify
This commit is contained in:
parent
1a09b41d19
commit
8a11832a07
|
@ -48,9 +48,9 @@ class BrokerConnection(object):
|
||||||
``amqplib``, ``pika``, ``redis``, ``memory``.
|
``amqplib``, ``pika``, ``redis``, ``memory``.
|
||||||
:keyword connect_timeout: Timeout in seconds for connecting to the
|
:keyword connect_timeout: Timeout in seconds for connecting to the
|
||||||
server. May not be suported by the specified transport.
|
server. May not be suported by the specified transport.
|
||||||
:keyword transport_options: A dict of additional connection arguments to pass to
|
:keyword transport_options: A dict of additional connection arguments to
|
||||||
alternate kombu channel implementations (useful for things like SQLAlchemy
|
pass to alternate kombu channel implementations. Consult the transport
|
||||||
engine arguments)
|
documentation for available options.
|
||||||
|
|
||||||
**Usage**
|
**Usage**
|
||||||
|
|
||||||
|
@ -81,7 +81,8 @@ class BrokerConnection(object):
|
||||||
|
|
||||||
def __init__(self, hostname="localhost", userid="guest",
|
def __init__(self, hostname="localhost", userid="guest",
|
||||||
password="guest", virtual_host="/", port=None, insist=False,
|
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.hostname = hostname
|
||||||
self.userid = userid
|
self.userid = userid
|
||||||
self.password = password
|
self.password = password
|
||||||
|
|
|
@ -22,7 +22,7 @@ class test_Connection(unittest.TestCase):
|
||||||
_connection = conn.connection
|
_connection = conn.connection
|
||||||
conn.close()
|
conn.close()
|
||||||
self.assertFalse(_connection.connected)
|
self.assertFalse(_connection.connected)
|
||||||
self.assertIsInstance(conn.transport, Transport)
|
self.assertIsInstance(conn.transport, Transport)
|
||||||
|
|
||||||
def test__enter____exit__(self):
|
def test__enter____exit__(self):
|
||||||
conn = self.conn
|
conn = self.conn
|
||||||
|
@ -100,12 +100,13 @@ class test_Connection(unittest.TestCase):
|
||||||
class test_Connection_With_Broker_Args(unittest.TestCase):
|
class test_Connection_With_Broker_Args(unittest.TestCase):
|
||||||
|
|
||||||
_extra_args = {
|
_extra_args = {
|
||||||
'pool_recycle' : 3600,
|
'pool_recycle': 3600,
|
||||||
'echo' : True
|
'echo': True
|
||||||
}
|
}
|
||||||
|
|
||||||
def setUp(self):
|
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):
|
def test_establish_connection(self):
|
||||||
conn = self.conn
|
conn = self.conn
|
||||||
|
|
Loading…
Reference in New Issue