diff options
author | Matus Valo <matusvalo@gmail.com> | 2020-05-15 17:06:27 +0200 |
---|---|---|
committer | Matus Valo <matusvalo@gmail.com> | 2020-05-15 17:08:29 +0200 |
commit | 963819dd73c2076c1cf5c82364da10acf87f90ce (patch) | |
tree | 49e6f50dee89e3c26d3df930454a44e5c62b278d /t | |
parent | 5101db177c1b2cee0febcc64ad0eb49b39c775e8 (diff) | |
download | kombu-963819dd73c2076c1cf5c82364da10acf87f90ce.tar.gz |
Improve integration test suit
Diffstat (limited to 't')
-rw-r--r-- | t/integration/common.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/t/integration/common.py b/t/integration/common.py index 90ab7df0..3ceeda3b 100644 --- a/t/integration/common.py +++ b/t/integration/common.py @@ -44,6 +44,22 @@ class BasicFunctionality(object): with consumer: conn.drain_events(timeout=1) + def test_consume_empty_queue(self, connection): + + def callback(body, message): + assert False, 'Callback should not be called' + + test_queue = kombu.Queue('test_empty', routing_key='test_empty') + with connection as conn: + with conn.channel() as channel: + consumer = kombu.Consumer( + conn, [test_queue], accept=['pickle'] + ) + consumer.register_callback(callback) + with consumer: + with pytest.raises(socket.timeout): + conn.drain_events(timeout=1) + def test_simple_queue_publish_consume(self, connection): with connection as conn: with closing(conn.SimpleQueue('simple_queue_test')) as queue: @@ -160,7 +176,7 @@ class BaseTimeToLive(object): test_queue = kombu.Queue('ttl_test', routing_key='ttl_test') def callback(body, message): - message.ack() + assert False, 'Callback should not be called' with connection as conn: with conn.channel() as channel: |