diff options
| author | Keith Wall <kwall@apache.org> | 2014-09-12 13:25:49 +0000 |
|---|---|---|
| committer | Keith Wall <kwall@apache.org> | 2014-09-12 13:25:49 +0000 |
| commit | a45156eed3719b9932f1ecc47777599a8215695b (patch) | |
| tree | b5e80075dc44c1fe17b6d57e51d145e7a81d7bee /qpid/python | |
| parent | 08def8999dd2b7c11a5aa59534021372d928f109 (diff) | |
| download | qpid-python-a45156eed3719b9932f1ecc47777599a8215695b.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@1624545 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/python')
| -rw-r--r-- | qpid/python/qpid/testlib.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/qpid/python/qpid/testlib.py b/qpid/python/qpid/testlib.py index 2b283f3998..d2617c5d18 100644 --- a/qpid/python/qpid/testlib.py +++ b/qpid/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): |
