diff options
| author | Alan Conway <aconway@apache.org> | 2007-03-16 22:31:08 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2007-03-16 22:31:08 +0000 |
| commit | 70e06534778acde7faae8298775857e5a0c56b5a (patch) | |
| tree | d949041a296fc6e24dc2363e5b1630f750963f38 /python/qpid/testlib.py | |
| parent | a324f15b525949d8b33c60ae031aa6dedae5f84f (diff) | |
| download | qpid-python-70e06534778acde7faae8298775857e5a0c56b5a.tar.gz | |
* python/tests_0-8/*: copy of python/tests to preserve 0-8 version of tests.
python/tests will be merged from the 0-9 branch.
* python/qpid/testlib.py: select tests or tests_0-8 based on spec version.
* python/tests_0-8/basic.py (BasicTests): replace get-ok with get_ok,
Python client now replaces - with _ for all names from the spec.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@519166 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/qpid/testlib.py')
| -rw-r--r-- | python/qpid/testlib.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/python/qpid/testlib.py b/python/qpid/testlib.py index 39bad75b86..b4534ab362 100644 --- a/python/qpid/testlib.py +++ b/python/qpid/testlib.py @@ -80,7 +80,7 @@ Options: def __init__(self): # Defaults self.setBroker("localhost") - self.spec = "../specs/amqp.0-8.xml" + self.specfile = "../specs/amqp.0-8.xml" self.verbose = 1 self.ignore = [] @@ -96,14 +96,22 @@ Options: self._die(str(e)) for opt, value in opts: if opt in ("-?", "-h", "--help"): self._die() - if opt in ("-s", "--spec"): self.spec = value + if opt in ("-s", "--spec"): self.specfile = value if opt in ("-b", "--broker"): self.setBroker(value) if opt in ("-v", "--verbose"): self.verbose = 2 if opt in ("-d", "--debug"): logging.basicConfig(level=logging.DEBUG) if opt in ("-i", "--ignore"): self.ignore.append(value) if opt in ("-I", "--ignore-file"): self.ignoreFile(value) - if len(self.tests) == 0: self.tests=findmodules("tests") + self.spec = qpid.spec.load(self.specfile) + if len(self.tests) == 0: + # NB: not a typo but a quirk of AMQP history. + # AMQP 0-8 identifies itself as 8-0. + if self.spec.major==8 and self.spec.minor==0: + testdir="tests_0-8" + else: + testdir="tests" + self.tests=findmodules(testdir) def testSuite(self): class IgnoringTestSuite(unittest.TestSuite): @@ -135,7 +143,7 @@ Options: spec = spec or self.spec user = user or self.user password = password or self.password - client = qpid.client.Client(host, port, qpid.spec.load(spec)) + client = qpid.client.Client(host, port, spec) client.start({"LOGIN": user, "PASSWORD": password}) return client |
