summaryrefslogtreecommitdiff
path: root/qpid/python/tests/example.py
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2007-03-16 22:54:11 +0000
committerAlan Conway <aconway@apache.org>2007-03-16 22:54:11 +0000
commit14f2a8d6398140ae72af9429c75179dde539c972 (patch)
tree18ec0035acf67f6b0aa93e097803c73f5f1a03f0 /qpid/python/tests/example.py
parent06fdb27fc4db7f2115d2fe1ca6290f07c0fb08c7 (diff)
downloadqpid-python-14f2a8d6398140ae72af9429c75179dde539c972.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@519171 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/python/tests/example.py')
-rw-r--r--qpid/python/tests/example.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/qpid/python/tests/example.py b/qpid/python/tests/example.py
index a1949ccb9f..7ab4cc7d0a 100644
--- a/qpid/python/tests/example.py
+++ b/qpid/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()