From 604a48cca8c6b9ce5cde84281cb979d508c037ca Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Tue, 6 Mar 2007 23:35:08 +0000 Subject: * python/qpid/peer.py (Channel.__init__): use reliable framing if version >= 0-8. * python/qpid/spec.py (Spec.__init__): Remove unused parameter. * python/qpid/testlib.py (TestRunner._parseargs): Add --errata option, set default errata only if --spec is not present. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/qpid.0-9@515363 13f79535-47bb-0310-9956-ffa450edef68 --- python/qpid/testlib.py | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'python/qpid/testlib.py') diff --git a/python/qpid/testlib.py b/python/qpid/testlib.py index 815d95ca26..4b78865e98 100644 --- a/python/qpid/testlib.py +++ b/python/qpid/testlib.py @@ -57,13 +57,14 @@ class TestRunner: run-tests [options] [test*] The name of a test is package.module.ClassName.testMethod Options: - -?/-h/--help : this message - -s/--spec : file containing amqp XML spec + -?/-h/--help : this message + -s/--spec : file containing amqp XML spec + -e/--errata : file containing amqp XML errata -b/--broker [[/]@][:] : broker to connect to - -v/--verbose : verbose - lists tests as they are run. - -d/--debug : enable debug logging. - -i/--ignore : ignore the named test. - -I/--ignore-file : file containing patterns to ignore. + -v/--verbose : verbose - lists tests as they are run. + -d/--debug : enable debug logging. + -i/--ignore : ignore the named test. + -I/--ignore-file : file containing patterns to ignore. """ sys.exit(1) @@ -81,10 +82,10 @@ Options: def __init__(self): # Defaults self.setBroker("localhost") - self.spec = "../specs/amqp.0-9.xml" - self.errata = "../specs/amqp-errata.0-9.xml" self.verbose = 1 self.ignore = [] + self.spec = None + self.errata = [] def ignoreFile(self, filename): f = file(filename) @@ -99,12 +100,20 @@ Options: for opt, value in opts: if opt in ("-?", "-h", "--help"): self._die() if opt in ("-s", "--spec"): self.spec = value + if opt in ("-e", "--errata"): self.errata.append(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) + # Default spec and errata. + if (self.spec == None): + if (len(self.errata)>0): + self._die("Specified errata with no spec.") + self.spec = "../specs/amqp.0-9.xml" + self.errata = ["../specs/amqp-errata.0-9.xml"] + # Default to running all tests. if len(self.tests) == 0: self.tests=findmodules("tests") def testSuite(self): @@ -142,7 +151,7 @@ Options: errata = errata or self.errata user = user or self.user password = password or self.password - client = qpid.client.Client(host, port, qpid.spec.load(spec, errata)) + client = qpid.client.Client(host, port, qpid.spec.load(spec, *errata)) client.start({"LOGIN": user, "PASSWORD": password}, tune_params=tune_params) return client -- cgit v1.2.1