kombu/t/unit
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
..
asynchronous enable pre-commit (#1355) 2021-07-20 19:07:49 +06:00
transport Return empty list instead of InconsistencyError when exchange table is empty 2021-10-25 07:28:10 +06:00
utils Remove dependency to case (#1389) 2021-09-15 21:00:08 +06:00
__init__.py pyupgrade 2020-07-13 16:58:06 +03:00
conftest.py Remove dependency to case (#1389) 2021-09-15 21:00:08 +06:00
test_clocks.py enable pre-commit (#1355) 2021-07-20 19:07:49 +06:00
test_common.py [pre-commit.ci] pre-commit autoupdate (#1393) 2021-09-27 21:35:17 +03:00
test_compat.py enable pre-commit (#1355) 2021-07-20 19:07:49 +06:00
test_compression.py Remove dependency to case (#1389) 2021-09-15 21:00:08 +06:00
test_connection.py enable pre-commit (#1355) 2021-07-20 19:07:49 +06:00
test_entity.py enable pre-commit (#1355) 2021-07-20 19:07:49 +06:00
test_exceptions.py Use unittest.mock instead of case 2020-08-16 20:39:26 +06:00
test_log.py enable pre-commit (#1355) 2021-07-20 19:07:49 +06:00
test_matcher.py enable pre-commit (#1355) 2021-07-20 19:07:49 +06:00
test_message.py enable pre-commit (#1355) 2021-07-20 19:07:49 +06:00
test_messaging.py enable pre-commit (#1355) 2021-07-20 19:07:49 +06:00
test_mixins.py Remove dependency to case (#1389) 2021-09-15 21:00:08 +06:00
test_pidbox.py Fix test_pidbox unittests to support non-linux platforms (#1398) 2021-10-05 22:37:59 +02:00
test_pools.py [pre-commit.ci] pre-commit autoupdate (#1393) 2021-09-27 21:35:17 +03:00
test_serialization.py Remove dependency to case (#1389) 2021-09-15 21:00:08 +06:00
test_simple.py enable pre-commit (#1355) 2021-07-20 19:07:49 +06:00