# HG changeset patch # User paulb # Date 1191113743 0 # Node ID acf1f7c6265b64a2ebd01246e6898fa398406fef # Parent 51b2dda8c61b57671a008ac2ccbf6bcb86c94b30 [project @ 2007-09-30 00:55:43 by paulb] Added XML-RPC support. Added tests of SOAP and XML-RPC. diff -r 51b2dda8c61b -r acf1f7c6265b tests/soap_test.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/soap_test.py Sun Sep 30 00:55:43 2007 +0000 @@ -0,0 +1,109 @@ +#!/usr/bin/env python +# -*- coding: iso-8859-15 -*- + +import libxml2dom.soap + +request = """ + + + 5 + + + + + FT35ZBQ + + + + Ĺke Jógvan Řyvind + + 123456789099999 + 2005-02 + + + +""" + +req = libxml2dom.soap.parseString(request) + +response = """ + + + 5 + + + + FT35ZBQ + + http://travelcompany.example.org/reservations?code=FT35ZBQ + + + +""" + +resp = libxml2dom.soap.parseString(response) + +response2 = """ + + + 5 + + + + m:status + confirmed + FT35ZBQ + + http://travelcompany.example.org/reservations?code=FT35ZBQ + + + +""" + +resp2 = libxml2dom.soap.parseString(response2) + +failed = """ + + + + + env:Sender + + rpc:BadArguments + + + + Processing error + Chyba zpracování + + + + Name does not match card number + 999 + + + + +""" + +f = libxml2dom.soap.parseString(failed) + +# vim: tabstop=4 expandtab shiftwidth=4 diff -r 51b2dda8c61b -r acf1f7c6265b tests/xmlrpc_test.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/xmlrpc_test.py Sun Sep 30 00:55:43 2007 +0000 @@ -0,0 +1,48 @@ +#!/usr/bin/env python + +import libxml2dom.xmlrpc + +request = """ + + examples.getStateName + + + 41 + + + """ + +req = libxml2dom.xmlrpc.parseString(request) + +response = """ + + + + South Dakota + + + """ + +resp = libxml2dom.xmlrpc.parseString(response) + +failed = """ + + + + + + faultCode + 4 + + + faultString + Too many parameters. + + + + + """ + +f = libxml2dom.xmlrpc.parseString(failed) + +# vim: tabstop=4 expandtab shiftwidth=4