diff options
author | RezaSi <rezashiri88@gmail.com> | 2020-11-17 11:36:43 +0330 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-17 14:06:43 +0600 |
commit | b8594f8a3372fda8f2fbf5d9644e4089ae921637 (patch) | |
tree | 0a8ef2f413e3a008662ed18f48996145280c295e /t | |
parent | 1f2392beae003383ad243d4e7bb18fcae0d27cf1 (diff) | |
download | kombu-b8594f8a3372fda8f2fbf5d9644e4089ae921637.tar.gz |
Add timeout to producer publish (#1269)
* Add timeout and confirm_timeout to producer publish
* Remove confirm_timeout and add test for timeout
* Fix test
Co-authored-by: Reza Shiri <rezashiri@cafebazaar.ir>
Diffstat (limited to 't')
-rw-r--r-- | t/unit/test_messaging.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/t/unit/test_messaging.py b/t/unit/test_messaging.py index 52c09ad3..dc673e07 100644 --- a/t/unit/test_messaging.py +++ b/t/unit/test_messaging.py @@ -137,6 +137,14 @@ class test_Producer: properties = p._channel.prepare_message.call_args[0][5] assert properties['expiration'] == '10000' + def test_publish_with_timeout(self): + p = self.connection.Producer() + p.channel = Mock() + p.channel.connection.client.declared_entities = set() + p.publish('test_timeout', exchange=Exchange('foo'), timeout=1) + timeout = p._channel.basic_publish.call_args[1]['timeout'] + assert timeout == 1 + def test_publish_with_reply_to(self): p = self.connection.Producer() p.channel = Mock() |