Skip to content

Commit

Permalink
Tests now passing again.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ask Solem committed Sep 16, 2010
1 parent b997b12 commit 79a815d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions carrot/messaging.py
Expand Up @@ -664,9 +664,9 @@ def declare(self):
"""
self.backend.exchange_declare(exchange=self.exchange,
type=self.exchange_type,
durable=self.durable,
auto_delete=self.auto_delete)
type=self.exchange_type,
durable=self.durable,
auto_delete=self.auto_delete)

def __enter__(self):
return self
Expand Down
7 changes: 4 additions & 3 deletions tests/backend.py
Expand Up @@ -39,7 +39,7 @@ def setUp(self):
def create_consumer(self, **options):
queue = "%s%s" % (self.queue, self.nextq())
return Consumer(connection=self.conn,
queue=queue, exchange=self.exchange + str(self.nextq),
queue=queue, exchange=self.exchange,
routing_key=self.routing_key, **options)

def create_consumerset(self, queues={}, consumers=[], **options):
Expand All @@ -54,11 +54,12 @@ def create_publisher(self, exchange=None, routing_key=None, **options):
**options)

def test_regression_implied_auto_delete(self):
consumer = self.create_consumer(exclusive=True)
consumer = self.create_consumer(exclusive=True, auto_declare=False)
self.assertTrue(consumer.auto_delete, "exclusive implies auto_delete")
consumer.close()

consumer = self.create_consumer(durable=True, auto_delete=False)
consumer = self.create_consumer(durable=True, auto_delete=False,
auto_declare=False)
self.assertFalse(consumer.auto_delete,
"""durable does *not* imply auto_delete.
regression: http://github.com/ask/carrot/issues/closed#issue/2""")
Expand Down

0 comments on commit 79a815d

Please sign in to comment.