summaryrefslogtreecommitdiff
path: root/python/tests/example.py
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2007-01-26 18:51:21 +0000
committerGordon Sim <gsim@apache.org>2007-01-26 18:51:21 +0000
commit81816f0a27c9115689a0e1f4c4b0b5bef6f71590 (patch)
tree55f4eb19666f7ce0e9d4229117a7542f62df141e /python/tests/example.py
parent9cc4cdaa54ec97aefb3ca2da9b437101b8127c2b (diff)
downloadqpid-python-81816f0a27c9115689a0e1f4c4b0b5bef6f71590.tar.gz
Updates to use message class in place of basic.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/qpid.0-9@500305 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/tests/example.py')
-rw-r--r--python/tests/example.py14
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()