summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorKeith Wall <kwall@apache.org>2014-09-12 13:25:49 +0000
committerKeith Wall <kwall@apache.org>2014-09-12 13:25:49 +0000
commit928ff6524cfb82da8cc9971bc60dbf5e4fd1ee80 (patch)
treeb3d087a845e82a3a641421a1e8fa3c43e7583502 /python
parentc61bc4a47f770e2d6562b6c7a12d26029c22d0f5 (diff)
downloadqpid-python-928ff6524cfb82da8cc9971bc60dbf5e4fd1ee80.tar.gz
QPID-6081, QPID-6082: [Python Client Tests] Add python tests for verifying the receipt of large messages occupying more than one frame (08-091)
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1624545 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python')
-rw-r--r--python/qpid/testlib.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/python/qpid/testlib.py b/python/qpid/testlib.py
index 2b283f3998..d2617c5d18 100644
--- a/python/qpid/testlib.py
+++ b/python/qpid/testlib.py
@@ -21,6 +21,9 @@
# Support library for qpid python tests.
#
+import string
+import random
+
import unittest, traceback, socket
import qpid.client, qmf.console
import Queue
@@ -77,8 +80,8 @@ class TestBase(unittest.TestCase):
"""Create a new connction, return the Client object"""
host = host or self.config.broker.host
port = port or self.config.broker.port or 5672
- user = user or "guest"
- password = password or "guest"
+ user = user or self.config.broker.user or "guest"
+ password = password or self.config.broker.password or "guest"
client = qpid.client.Client(host, port)
try:
if client.spec.major == 8 and client.spec.minor == 0:
@@ -114,9 +117,14 @@ class TestBase(unittest.TestCase):
if not "uniqueCounter" in dir(self): self.uniqueCounter = 1;
return "Test Message " + str(self.uniqueCounter)
- def consume(self, queueName):
+ def randomLongString(self, length=65535):
+ body = ''.join(random.choice(string.ascii_uppercase) for _ in range(length))
+ return body
+
+ def consume(self, queueName, no_ack=True):
"""Consume from named queue returns the Queue object."""
- reply = self.channel.basic_consume(queue=queueName, no_ack=True)
+
+ reply = self.channel.basic_consume(queue=queueName, no_ack=no_ack)
return self.client.queue(reply.consumer_tag)
def subscribe(self, channel=None, **keys):