summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2015-03-04 21:02:16 +0000
committerGordon Sim <gsim@apache.org>2015-03-04 21:02:16 +0000
commite2e5605ff0f0597bbb2a596ae2c9e0dc54aef7f0 (patch)
treed285e6c27623007c713e611fbf61161e13fbd1ea
parent37fe66d68304d1b112f0bb012665e12140250bed (diff)
downloadqpid-python-e2e5605ff0f0597bbb2a596ae2c9e0dc54aef7f0.tar.gz
QPID-4710: adjust version checking used by new tx interop tests so as not to fail existing tests when either ptoron python lib is not on path or is 0.7 or earlier
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1664144 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/cpp/src/tests/brokertest.py19
1 files changed, 16 insertions, 3 deletions
diff --git a/qpid/cpp/src/tests/brokertest.py b/qpid/cpp/src/tests/brokertest.py
index 2566bc527d..6fae88092b 100644
--- a/qpid/cpp/src/tests/brokertest.py
+++ b/qpid/cpp/src/tests/brokertest.py
@@ -21,7 +21,6 @@
import os, signal, string, tempfile, subprocess, socket, threading, time, imp, re
import qpid, traceback, signal
-import proton
from qpid import connection, util
from qpid.compat import format_exc
from unittest import TestCase
@@ -493,7 +492,16 @@ class BrokerTest(TestCase):
test_store_lib = os.getenv("TEST_STORE_LIB")
rootdir = os.getcwd()
- PN_VERSION = (proton.VERSION_MAJOR, proton.VERSION_MINOR)
+ try:
+ import proton
+ PN_VERSION = (proton.VERSION_MAJOR, proton.VERSION_MINOR)
+ except ImportError:
+ # proton not on path, can't determine version
+ PN_VERSION = (0, 0)
+ except AttributeError:
+ # prior to 0.8 proton did not expose version info
+ PN_VERSION = (0, 7)
+
PN_TX_VERSION = (0, 9)
amqp_tx_supported = PN_VERSION >= PN_TX_VERSION
@@ -501,7 +509,12 @@ class BrokerTest(TestCase):
@classmethod
def amqp_tx_warning(cls):
if not cls.amqp_tx_supported:
- print "WARNING: Cannot test transactions over AMQP 1.0, proton version %s.%s < %s.%s" % (cls.PN_VERSION + cls.PN_TX_VERSION)
+ if cls.PN_VERSION == (0, 0):
+ print "WARNING: Cannot test transactions over AMQP 1.0, proton not on path so version could not be determined"
+ elif cls.PN_VERSION == (0, 7):
+ print "WARNING: Cannot test transactions over AMQP 1.0, proton version is 0.7 or less, %s.%s required" % cls.PN_TX_VERSION
+ else:
+ print "WARNING: Cannot test transactions over AMQP 1.0, proton version %s.%s < %s.%s" % (cls.PN_VERSION + cls.PN_TX_VERSION)
return False
return True