QA/Testopia/XmlRpc

I've cleaned up the stuff below somewhat and posted as a patch to: - see patch attached to https://bugzilla.mozilla.org/show_bug.cgi?id=423637 Usage: from pprint import pprint

from testopia import Testopia

t = Testopia('me@example.com', 'my_password', 'https://publictest2.fedoraproject.org/bugzilla/tr_xmlrpc.cgi')

pprint (t.testcase_list)
 * OK, should be able to use the interface to xmlrpc:

Older version
from pprint import pprint
 * 1) We'll be working with nested dictionaries etc, so we'll want pretty-printing
 * 2) support to keep us sane:

from testopia import Testopia
 * 1) testopia tarball's "contrib" subdir has a testopia.py module that wraps
 * 2) the XML-RPC interface, supplying handy marshalling that hides some of
 * 3) the Perl/Python mismatches
 * 4) I have this installed in site-packages for now, to avoid having
 * 5) to set import path etc:


 * 1) Unfortunately, the above seems to expect x509 certs for auth
 * 2) So we'll hack around it, by passing dummy values, then overriding to use
 * 3) a cookie-based implementation

import xmlrpclib from cookielib import MozillaCookieJar from bugzilla import SafeCookieTransport
 * 1) wwoods' interface to rh bugzilla has a different xmlrpc mechanism, but we'll
 * 2) use the cookie-handling from it:

cookieServerProxy = xmlrpclib.ServerProxy('https://publictest2.fedoraproject.org/bugzilla/tr_xmlrpc.cgi',                                         transport=SafeCookieTransport,                                          verbose = False) # or True cookieServerProxy._ServerProxy__transport.cookiejar = MozillaCookieJar('epiphany-cookies.txt') cookieServerProxy._ServerProxy__transport.cookiejar.load # needed for some reason
 * 1) Point it at your browser cookies.
 * 2) It can corrupt the file, so point it at a copy:

t = Testopia('foo', 'bar') t.server = cookieServerProxy
 * 1) Hack around assumptions in Testopia class, by passing dummy values, then overriding to use
 * 2) a cookie-based implementation

pprint (t.testcase_list)
 * OK, should be able to use the interface to xmlrpc:

for case in t.testcase_list: print case['summary']


 * 1) etc