ó {G_Tc@s¿ddlmZddlZddlZddlmZejdƒZddlZddlZddl Z da d„Z d„Z de jfd„ƒYZd „Zed kr»eƒndS( iÿÿÿÿ(tDocXMLRPCServerN(t test_supportt threadingcs |s d„S‡fd†}|S(NcSs|S(N((tfunc((s//usr/local/lib/python2.7/test/test_docxmlrpc.pytscs‡fd†}|S(Ncs3|jjddƒ|jjƒtjˆƒ‚dS(NtGETt/(tclienttrequestt getresponsetunittesttSkipTest(tself(treason(s//usr/local/lib/python2.7/test/test_docxmlrpc.pytmake_request_and_skips ((RR(R (s//usr/local/lib/python2.7/test/test_docxmlrpc.pyt decorators((t conditionR R((R s//usr/local/lib/python2.7/test/test_docxmlrpc.pytmake_request_and_skipIf scCs td dtƒ}zÖy»|jjƒda|jdƒ|jdƒ|jdƒdtfd „ƒY}|j ƒ|j |ƒƒd „}|j |ƒ|j d „ƒx$|dkrÎ|j ƒ|d8}q«WWntj k rænXWd|jƒda|jƒXdS( Nt localhostit logRequestsis"DocXMLRPCServer Test DocumentationsDocXMLRPCServer Test DocssmThis is an XML-RPC server's documentation, but the server can be used by POSTing to /RPC2. Try self.add, too.t TestClasscBseZd„ZRS(cSs ||_dS(s7Test method's docs. This method truly does very little.N(targ(R R((s//usr/local/lib/python2.7/test/test_docxmlrpc.pyt test_method*s(t__name__t __module__R(((s//usr/local/lib/python2.7/test/test_docxmlrpc.pyR)scSs||S(sAdd two instances together. This follows PEP008, but has nothing to do with RFC1952. Case should matter: pEp008 and rFC1952. Things that start with http and ftp should be auto-linked, too: http://google.com. ((txty((s//usr/local/lib/python2.7/test/test_docxmlrpc.pytadd1scSs||S(N((RR((s//usr/local/lib/python2.7/test/test_docxmlrpc.pyR:s(Ri(RtFalsetsockett getsocknametPORTtset_server_titletset_server_nametset_server_documentationtobjectt register_introspection_functionstregister_instancetregister_functionthandle_requestttimeoutt server_closetNonetset(tevtt numrequeststservRR((s//usr/local/lib/python2.7/test/test_docxmlrpc.pytservers,       tDocXMLRPCHTTPGETServercBs†eZd„Zd„Zd„Zd„Zd„Zeej j dkdƒd„ƒZ eej j dkdƒd„ƒZ d „Z RS( cCs¢tjƒ|_tt_tjƒ|_tj dt d|jdfƒj ƒd}x3|dkr‡t dkr‡tjdƒ|d8}qUWtjdt ƒ|_dS(Nttargettargsiièigü©ñÒMbP?s localhost:%d(Rtthreading_setupt_threadstTrueRt_send_traceback_headerRtEventR,tThreadR/tstartRR*ttimetsleepthttplibtHTTPConnectionR(R tn((s//usr/local/lib/python2.7/test/test_docxmlrpc.pytsetUpGs % cCs7|jjƒ|jjƒtt_tj|j ŒdS(N( RtcloseR,twaitRRR6Rtthreading_cleanupR4(R ((s//usr/local/lib/python2.7/test/test_docxmlrpc.pyttearDownWs   cCs\|jjddƒ|jjƒ}|j|jdƒ|j|jdƒdƒ|jƒdS(NRRiÈs Content-types text/html(RRR t assertEqualtstatust getheadertread(R tresponse((s//usr/local/lib/python2.7/test/test_docxmlrpc.pyttest_valid_get_response`s cCs\|jjddƒ|jjƒ}|j|jdƒ|j|jdƒdƒ|jƒdS(NRs/spami”s Content-types text/plain(RRR RDRERFRG(R RH((s//usr/local/lib/python2.7/test/test_docxmlrpc.pyttest_invalid_get_responsejs cCs<|jjddƒ|jjƒ}|jd|jƒƒdS(séTest that lambda functionality stays the same. The output produced currently is, I suspect invalid because of the unencoded brackets in the HTML, "". The subtraction lambda method is tested. RRsU
<lambda>(x, y)
N(RRR tassertInRG(R RH((s//usr/local/lib/python2.7/test/test_docxmlrpc.pyt test_lambdass is)Docstrings are omitted with -O2 and abovecCs<|jjddƒ|jjƒ}|jd|jƒƒdS(sTest that the server correctly automatically wraps references to PEPS and RFCs with links, and that it linkifies text starting with http or ftp protocol prefixes. The documentation for the "add" method contains the test material. RRsM
add(x, y)
Add two instances together. This follows PEP008, but has nothing
to do with RFC1952. Case should matter: pEp008 and rFC1952.  Things
that start with http and ftp should be auto-linked, too:
http://google.com.
N(RRR RKRG(R RH((s//usr/local/lib/python2.7/test/test_docxmlrpc.pyttest_autolinkings  cCs<|jjddƒ|jjƒ}|jd|jƒƒdS(s³Test the precense of three consecutive system.* methods. This also tests their use of parameter type recognition and the systems related to that process. RRs'
system.listMethods()
system.listMethods() => ['add', 'subtract', 'multiple']
 
Returns a list of the methods supported by the server.
system.methodHelp(method_name)
system.methodHelp('add') => "Adds two integers together"
 
Returns a string containing documentation for the specified method.
system.methodSignature(method_name)
system.methodSignature('add') => [double, int, int]
 
Returns a list describing the signature of the method. In the
above example, the add method takes two integers as arguments
and returns a double result.
 
This server does NOT support system.methodSignature.
N(RRR RKRG(R RH((s//usr/local/lib/python2.7/test/test_docxmlrpc.pyttest_system_methods™s cCs<|jjddƒ|jjƒ}|jd|jƒƒdS(sTTest that selfdot values are made strong automatically in the documentation.RRs-Try self.add, too.N(RRR RKRG(R RH((s//usr/local/lib/python2.7/test/test_docxmlrpc.pyttest_autolink_dotted_methods¼s (RRR?RCRIRJRLRtsystflagstoptimizeRMRNRO(((s//usr/local/lib/python2.7/test/test_docxmlrpc.pyR0Fs  "cCstjtƒdS(N(Rt run_unittestR0(((s//usr/local/lib/python2.7/test/test_docxmlrpc.pyt test_mainÅst__main__(RR<RPttestRt import_moduleRR:RR R*RRR/tTestCaseR0RTR(((s//usr/local/lib/python2.7/test/test_docxmlrpc.pyts       ,