From 9bef9a1fc149669fe41c40a6b1ecc8423f5b1174 Mon Sep 17 00:00:00 2001
From: Piotr Maslanka <piotr.maslanka@henrietta.com.pl>
Date: Tue, 10 Jan 2017 06:48:41 +0100
Subject: [PATCH] heh travis rmq

---
 Vagrantfile                   |  1 +
 coolamqp/attaches/consumer.py | 10 +++++-----
 coolamqp/objects.py           |  4 ++--
 setup.py                      |  3 ++-
 4 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/Vagrantfile b/Vagrantfile
index d395929..791bddf 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -23,6 +23,7 @@ Vagrant.configure("2") do |config|
      sudo service rabbitmq-server restart
      rabbitmqctl add_user user user
      rabbitmqctl set_permissions -p / user ".*" ".*" ".*"
+     rabbitmqctl set_permissions -p / guest ".*" ".*" ".*"
      rabbitmqctl set_user_tags user administrator
 
      # Install deps
diff --git a/coolamqp/attaches/consumer.py b/coolamqp/attaches/consumer.py
index c0e211d..f64b551 100644
--- a/coolamqp/attaches/consumer.py
+++ b/coolamqp/attaches/consumer.py
@@ -159,7 +159,7 @@ class Consumer(Channeler):
 
         if isinstance(payload, BasicCancel):
             # Consumer Cancel Notification - by RabbitMQ
-            self.methods([BasicCancelOk(), ChannelClose(0, b'Received basic.cancel', 0, 0)])
+            self.methods([BasicCancelOk(payload.consumer_tag.tobytes()), ChannelClose(0, b'Received basic.cancel', 0, 0)])
             return
 
         if isinstance(payload, BasicCancelOk):
@@ -243,7 +243,7 @@ class Consumer(Channeler):
         elif isinstance(payload, ExchangeDeclareOk):
             # Declare the queue
 
-            name = b'' if self.queue.anonymous else self.queue.name.encode('utf8')
+            name = b'' if self.queue.anonymous else self.queue.name
 
             self.connection.method_and_watch(
                 self.channel_id,
@@ -263,13 +263,13 @@ class Consumer(Channeler):
         elif isinstance(payload, QueueDeclareOk):
             # did we need an anonymous name?
             if self.queue.anonymous:
-                self.queue.name = payload.queue_name.decode('utf8')
+                self.queue.name = payload.queue_name.tobytes()
 
             # We need any form of binding.
             if self.queue.exchange is not None:
                 self.method_and_watch(
                     QueueBind(
-                        self.queue.name.encode('utf8'), self.queue.exchange.name.encode('utf8'),
+                        self.queue.name, self.queue.exchange.name.encode('utf8'),
                         b'', False, []),
                     QueueBindOk,
                     self.on_setup
@@ -282,7 +282,7 @@ class Consumer(Channeler):
             if self.qos is not None:
                 self.method(BasicQos(self.qos[0], self.qos[1], False))
             self.method_and_watch(
-                BasicConsume(self.queue.name.encode('utf8'), self.queue.name.encode('utf8'),
+                BasicConsume(self.queue.name, self.queue.name,
                     False, self.no_ack, self.queue.exclusive, False, []),
                 BasicConsumeOk,
                 self.on_setup
diff --git a/coolamqp/objects.py b/coolamqp/objects.py
index 6d2fcc4..9a45df8 100644
--- a/coolamqp/objects.py
+++ b/coolamqp/objects.py
@@ -108,7 +108,7 @@ class Exchange(object):
 
     direct = None   # the direct exchange
 
-    def __init__(self, name='', type='direct', durable=True, auto_delete=False):
+    def __init__(self, name=u'', type='direct', durable=True, auto_delete=False):
         self.name = name
         self.type = type
         self.durable = durable
@@ -142,7 +142,7 @@ class Queue(object):
         :param exclusive: Is this queue exclusive?
         :param auto_delete: Is this queue auto_delete ?
         """
-        self.name = name.encode('utf8')
+        self.name = name.encode('utf8')     #: public, this is of type bytes ALWAYS
         # if name is '', this will be filled in with broker-generated name upon declaration
         self.durable = durable
         self.exchange = exchange
diff --git a/setup.py b/setup.py
index dfb116e..db8fae1 100644
--- a/setup.py
+++ b/setup.py
@@ -36,7 +36,8 @@ setup(name='CoolAMQP',
             'Programming Language :: Python :: Implementation :: CPython',
             'Programming Language :: Python :: Implementation :: PyPy',
             'Operating System :: OS Independent',
-            'Development Status :: 5 - Production/Stable',
+#            'Development Status :: 5 - Production/Stable',
+            'Development Status :: 4 - Beta',
             'License :: OSI Approved :: MIT License',
             'Topic :: Software Development :: Libraries'
       ]
-- 
GitLab