diff options
author | Gordon Sim <gsim@apache.org> | 2008-04-22 12:05:52 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2008-04-22 12:05:52 +0000 |
commit | 61959e29ee69f9cebb61b845272eededaec6f11e (patch) | |
tree | 2900fad5b05b665219197e2cbd6c7254b476d09e /python/tests_0-10/message.py | |
parent | 2b8e82875776feb8393c7791975acc9cf9fdb5e1 (diff) | |
download | qpid-python-61959e29ee69f9cebb61b845272eededaec6f11e.tar.gz |
QPID-944: do no-local checking where requested when there is an exclusive subscription active
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@650450 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/tests_0-10/message.py')
-rw-r--r-- | python/tests_0-10/message.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/python/tests_0-10/message.py b/python/tests_0-10/message.py index 2b1b446e7a..8302515b2f 100644 --- a/python/tests_0-10/message.py +++ b/python/tests_0-10/message.py @@ -92,6 +92,34 @@ class MessageTests(TestBase010): #check queue is empty self.assertEqual(0, session.queue_query(queue="test-queue").message_count) + def test_no_local_exclusive_subscribe(self): + """ + Test that the no_local flag is honoured in the consume method + """ + session = self.session + + #setup, declare two queues one of which excludes delivery of + #locally sent messages but is not declared as exclusive + session.queue_declare(queue="test-queue-1a", exclusive=True, auto_delete=True) + session.queue_declare(queue="test-queue-1b", auto_delete=True, arguments={'no-local':'true'}) + #establish two consumers + self.subscribe(destination="local_included", queue="test-queue-1a") + self.subscribe(destination="local_excluded", queue="test-queue-1b", exclusive=True) + + #send a message + session.message_transfer(message=Message(session.delivery_properties(routing_key="test-queue-1a"), "deliver-me")) + session.message_transfer(message=Message(session.delivery_properties(routing_key="test-queue-1b"), "dont-deliver-me")) + + #check the queues of the two consumers + excluded = session.incoming("local_excluded") + included = session.incoming("local_included") + msg = included.get(timeout=1) + self.assertEqual("deliver-me", msg.body) + try: + excluded.get(timeout=1) + self.fail("Received locally published message though no_local=true") + except Empty: None + def test_consume_exclusive(self): """ |