def test_expat_error(self): # If an `ExpatError` is raised when sniffing for XML-RPC capabilities, # it is taken to mean that no XML-RPC capabilities exist. bugzilla = Bugzilla("http://not.real") class Transport(xmlrpclib.Transport): def request(self, host, handler, request, verbose=None): raise ExpatError("mismatched tag") bugzilla._test_xmlrpc_proxy = xmlrpclib.ServerProxy("%s/xmlrpc.cgi" % bugzilla.baseurl, transport=Transport()) # We must abort any existing transactions before attempting to call # the _remoteSystemHas*() functions because they require that none be # in progress. transaction.abort() self.assertFalse(bugzilla._remoteSystemHasBugzillaAPI()) self.assertFalse(bugzilla._remoteSystemHasPluginAPI())
def test_expat_error(self): # If an `ExpatError` is raised when sniffing for XML-RPC capabilities, # it is taken to mean that no XML-RPC capabilities exist. bugzilla = Bugzilla("http://not.real") class Transport(xmlrpclib.Transport): def request(self, host, handler, request, verbose=None): raise ExpatError("mismatched tag") bugzilla._test_xmlrpc_proxy = xmlrpclib.ServerProxy( '%s/xmlrpc.cgi' % bugzilla.baseurl, transport=Transport()) # We must abort any existing transactions before attempting to call # the _remoteSystemHas*() functions because they require that none be # in progress. transaction.abort() self.assertFalse(bugzilla._remoteSystemHasBugzillaAPI()) self.assertFalse(bugzilla._remoteSystemHasPluginAPI())