You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kw...@apache.org on 2016/04/03 00:28:45 UTC
svn commit: r1737539 -
/qpid/trunk/qpid/python/qpid/tests/messaging/__init__.py
Author: kwall
Date: Sat Apr 2 22:28:45 2016
New Revision: 1737539
URL: http://svn.apache.org/viewvc?rev=1737539&view=rev
Log:
QPID-7180: [Python Test Suite] Adapt broker url to match expectations of the C++ client if swigged client is in-use
Modified:
qpid/trunk/qpid/python/qpid/tests/messaging/__init__.py
Modified: qpid/trunk/qpid/python/qpid/tests/messaging/__init__.py
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/python/qpid/tests/messaging/__init__.py?rev=1737539&r1=1737538&r2=1737539&view=diff
==============================================================================
--- qpid/trunk/qpid/python/qpid/tests/messaging/__init__.py (original)
+++ qpid/trunk/qpid/python/qpid/tests/messaging/__init__.py Sat Apr 2 22:28:45 2016
@@ -22,6 +22,7 @@ from math import ceil
from qpid.harness import Skipped
from qpid.tests.messaging.implementation import *
from qpid.tests import Test
+from qpid.util import URL
class Base(Test):
@@ -39,7 +40,11 @@ class Base(Test):
def setup(self):
self.test_id = uuid4()
- self.broker = self.config.broker
+ if self.is_swigged_qpid_messaging():
+ self.broker = CompatURL(self.config.broker)
+ else:
+ self.broker = self.config.broker
+
try:
self.conn = self.setup_connection()
except ConnectError, e:
@@ -188,6 +193,9 @@ class Base(Test):
return {"reconnect": self.reconnect(),
"transport": self.transport()}
+ def is_swigged_qpid_messaging(self):
+ return Connection.__module__ == 'qpid_messaging'
+
class VersionTest (Base):
def create_connection(self, version="amqp1.0", force=False):
opts = self.connection_options()
@@ -201,4 +209,28 @@ class VersionTest (Base):
def setup_session(self):
return self.conn.session()
+class CompatURL(URL):
+ """The formation of the URL for the C++ client is different to that of the pure Python client in that
+ the C++ client expects <scheme>:<user>/<pass>.. whereas the pure Python's URL class expects
+ <scheme>://<user>:<pass>.."""
+ def __init__(self, *args, **kwargs):
+ URL.__init__(self, *args, **kwargs)
+
+ def __str__(self):
+ s = ""
+ if self.scheme:
+ s += "%s:" % self.scheme
+ if self.user:
+ s += self.user
+ if self.password:
+ s += "/%s" % self.password
+ s += "@"
+ if ':' not in self.host:
+ s += self.host
+ else:
+ s += "[%s]" % self.host
+ if self.port:
+ s += ":%s" % self.port
+ return s
+
import address, endpoints, message
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org