Skip to content
Snippets Groups Projects
Commit 99db8839 authored by Piotr Maślanka's avatar Piotr Maślanka
Browse files

2.1.2 test release

parent 21599191
Branches master
Tags v2.1.2
No related merge requests found
Pipeline #64176 passed with stages
in 3 minutes and 9 seconds
......@@ -5,7 +5,8 @@ v2.1.2
======
* extra_properties passed to Cluster might now be a dict
* basically all arguments can be passed as dicts
* basically all arguments and argument_binds can be passed as dicts
* removed a bogus warning
v2.1.1
======
......
__version__ = '2.1.2a1'
__version__ = '2.1.2'
import warnings
import six
from coolamqp.framing.field_table import get_type_for
......@@ -17,27 +15,27 @@ def tobytes(q):
def toutf8(q):
if isinstance(q, memoryview):
q = q.tobytes().decode('utf-8')
q = q.tobytes()
return q.decode('utf-8') if isinstance(q, six.binary_type) else q
def argumentify(arguments):
if arguments is None:
return []
args = []
if isinstance(arguments, dict):
for key, value in arguments.items():
key = tobytes(key)
args.append((key, (value, get_type_for(value))))
return (args, 'F')
return args, 'F'
elif len(arguments[0]) == 2:
for key, value in arguments:
key = tobytes(key)
args.append((key, (value, get_type_for(value))))
return (args, 'F')
return args, 'F'
elif isinstance(arguments, (list, tuple)):
for value in arguments:
args.append((value, get_type_for(value)))
return (args, 'A')
warnings.warn('Unnecessary call to argumentify, see issue #11 for details', UserWarning)
return args, 'A'
return args
......@@ -78,10 +78,7 @@ class Cluster(object):
raise RuntimeError('tracer given, but opentracing is not installed!')
if isinstance(extra_properties, dict):
extra_props = []
for key, value in extra_properties.items():
extra_props.append((tobytes(key), argumentify(value)))
extra_properties = extra_props
extra_properties = argumentify(extra_properties)[0]
self.started = False # type: bool
self.tracer = tracer
......
......@@ -3,7 +3,7 @@ services:
amqp:
image: rabbitmq:4.0-management
unittest:
command: nose2 -vv
command: coverage run --append -m nose2 -F -vv
build:
context: .
dockerfile: tests/Dockerfile
......
......@@ -7,6 +7,8 @@ pick their names for themselves.
It also forbids some combinations of Queue arguments, and makes the default values more palatable, so for example
a naked :class:`coolamqp.objects.Queue` will be anonymous, non-durable, exclusive and auto-delete.
Also, any arguments marked as arguments or arguments_bind may accept a dictionary safely.
Cluster.publish
---------------
......
......@@ -14,8 +14,11 @@ from coolamqp.exceptions import ConnectionDead
from coolamqp.objects import NodeDefinition, Queue, Exchange
NODE = NodeDefinition(os.environ.get('AMQP_HOST', '127.0.0.1'), 'guest', 'guest', heartbeat=20)
logging.basicConfig(level=logging.DEBUG)
logging.getLogger('coolamqp').setLevel(logging.DEBUG)
logging.basicConfig(level=logging.DEBUG,
format='[%(asctime)s] p%(process)s {%(pathname)s:%(lineno)d} %(levelname)s - %(message)s',
datefmt='%Y-%m-%d:%H:%M:%S',)
class TestConnecting(unittest.TestCase):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment