kombu/t/unit/transport
Matus Valo 73b10a9346 Return empty list instead of InconsistencyError when exchange table is empty
Missing redis key containg set of queues bound to queue is caused
by removal all queues from the exchange. Hence, we should not raise an
exception but just return empty list of queues instead. This commit
fixes e.g. case publishing message against empty exchange:

import kombu
conn = kombu.Connection('redis://')
exchange = kombu.Exchange('name', type='direct')
exchange.declare(channel=conn.default_channel)

producer = conn.Producer()
producer.publish(
     {'hello': 'world'},
     exchange=exchange,
     routing_key='queue1'
)

But it also fixes the case when last queue is unbound from exchange and
after publishing to this exchange:

import kombu
conn = kombu.Connection('redis://')
exchange = kombu.Exchange('name', type='direct')
queue1 = kombu.Queue('queue1', exchange=exchange, routing_key='queue1')
exchange.declare(channel=conn.default_channel)
queue1 = queue1.bind(channel=conn.default_channel)
queue1.declare()

producer = conn.Producer()
producer.publish(
     {'hello': 'world'},
     exchange=exchange,
     routing_key='queue1'
)

queue1.delete()

producer.publish(
     {'hello': 'world'},
     exchange=exchange,
     routing_key='queue1'
)
2021-10-25 07:28:10 +06:00
..
virtual [pre-commit.ci] pre-commit autoupdate (#1393) 2021-09-27 21:35:17 +03:00
__init__.py Rewrite tests to use py.test 2016-08-23 11:38:54 -07:00
test_SQS.py SQS Channel.predefined_queues should be `{}` if not defined 2021-08-21 16:22:41 +06:00
test_azureservicebus.py enable pre-commit (#1355) 2021-07-20 19:07:49 +06:00
test_base.py enable pre-commit (#1355) 2021-07-20 19:07:49 +06:00
test_consul.py enable pre-commit (#1355) 2021-07-20 19:07:49 +06:00
test_etcd.py enable pre-commit (#1355) 2021-07-20 19:07:49 +06:00
test_filesystem.py enable pre-commit (#1355) 2021-07-20 19:07:49 +06:00
test_librabbitmq.py enable pre-commit (#1355) 2021-07-20 19:07:49 +06:00
test_memory.py enable pre-commit (#1355) 2021-07-20 19:07:49 +06:00
test_mongodb.py enable pre-commit (#1355) 2021-07-20 19:07:49 +06:00
test_pyamqp.py Remove dependency to case (#1389) 2021-09-15 21:00:08 +06:00
test_pyro.py enable pre-commit (#1355) 2021-07-20 19:07:49 +06:00
test_qpid.py enable pre-commit (#1355) 2021-07-20 19:07:49 +06:00
test_redis.py Return empty list instead of InconsistencyError when exchange table is empty 2021-10-25 07:28:10 +06:00
test_sqlalchemy.py enable pre-commit (#1355) 2021-07-20 19:07:49 +06:00
test_transport.py Use unittest.mock instead of case 2020-08-16 20:39:26 +06:00
test_zookeeper.py enable pre-commit (#1355) 2021-07-20 19:07:49 +06:00