diff options
author | Alan Conway <aconway@apache.org> | 2007-03-16 22:54:11 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2007-03-16 22:54:11 +0000 |
commit | 15256f1f40f96392028f6182cecf29ff334dbe72 (patch) | |
tree | 3c443c2444ee44d42132bbf164d5ee2746beeda8 /python/tests/example.py | |
parent | 70e06534778acde7faae8298775857e5a0c56b5a (diff) | |
download | qpid-python-15256f1f40f96392028f6182cecf29ff334dbe72.tar.gz |
Merged revisions 500305 via svnmerge from
https://svn.apache.org/repos/asf/incubator/qpid/branches/qpid.0-9
........
r500305 | gsim | 2007-01-26 13:51:21 -0500 (Fri, 26 Jan 2007) | 3 lines
Updates to use message class in place of basic.
........
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@519171 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/tests/example.py')
-rw-r--r-- | python/tests/example.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/python/tests/example.py b/python/tests/example.py index a1949ccb9f..7ab4cc7d0a 100644 --- a/python/tests/example.py +++ b/python/tests/example.py @@ -68,18 +68,18 @@ class ExampleTest (TestBase): # has fields corresponding to the reply method fields, plus a content # field that is filled if the reply includes content. In this case the # interesting field is the consumer_tag. - reply = channel.basic_consume(queue="test-queue") + channel.message_consume(queue="test-queue", destination="consumer_tag") # We can use the Client.queue(...) method to access the queue # corresponding to our consumer_tag. - queue = self.client.queue(reply.consumer_tag) + queue = self.client.queue("consumer_tag") # Now lets publish a message and see if our consumer gets it. To do # this we need to import the Content class. body = "Hello World!" - channel.basic_publish(exchange="test", - routing_key="key", - content=Content(body)) + channel.message_transfer(destination="test", + routing_key="key", + body = body) # Now we'll wait for the message to arrive. We can use the timeout # argument in case the server hangs. By default queue.get() will wait @@ -87,8 +87,8 @@ class ExampleTest (TestBase): msg = queue.get(timeout=10) # And check that we got the right response with assertEqual - self.assertEqual(body, msg.content.body) + self.assertEqual(body, msg.body) # Now acknowledge the message. - channel.basic_ack(msg.delivery_tag, True) + msg.ok() |