+
    üÐjhw  ã                   óÐ  € R t ^ RIt^ RIHtHt ^ RIHt ^ RIHtH	t	 ^ RI
Ht ^ RIHtHt ^ RIHtHtHtHt ^ RIHt ^ R	IHtHt ^ R
IHt ^ RIHt ^ RIHtHtHtH t H!t! ^ RI"H#t# ^ RI$H%t%H&t&H't'H(t(H)t)H*t*  ]! R4       Rt+ ! R R]PZ                  4      t. ! R R]/4      t0 ! R R]14      t2 ! R R]%4      t3 ! R R]%4      t4 ! R R]%4      t5 ! R R]34      t6 ! R  R!]!Pn                  4      t8 ! R" R#]!PL                  4      t9 ! R$ R%]!PL                  4      t: ! R& R']PZ                  4      t; ! R( R)];4      t< ! R* R+]PZ                  4      t= ! R, R-4      t> ! R. R/]>]PZ                  4      t? ! R0 R1]>]PZ                  4      t@ ! R2 R3];4      tA ! R4 R5];4      tB ! R6 R7]PZ                  4      tC ! R8 R9]PZ                  4      tD ! R: R;]PZ                  4      tER#   ], d    Rt+ ELdi ; i)<z6
Tests for  XML-RPC support in L{twisted.web.xmlrpc}.
N)ÚBytesIOÚStringIO)ÚskipIf)ÚdeferÚreactor)ÚConnectionDone)ÚEventLoggingObserverÚMemoryReactor)ÚFilteringLogObserverÚLogLevelÚLogLevelFilterPredicateÚglobalLogPublisher)Úfailure)ÚnativeStringÚnetworkString)ÚnamedModule)Úunittest)ÚclientÚhttpÚserverÚstaticÚxmlrpc)ÚDummyRequest)ÚXMLRPCÚQueryFactoryÚaddIntrospectionÚpayloadTemplateÚwithRequestÚ	xmlrpclibztwisted.internet.sslFTc                   ó6   a € ] tR t^.t o RtR tR tR tRtV t	R# )ÚAsyncXMLRPCTestsz-
Tests for L{XMLRPC}'s support of Deferreds.
c                ó6  a€ \        R .4      V n        RV P                  n        \        \        R\
        P                  ! R4      3,          4      V P                  n        \        P                  ! 4       ;oV n
         ! V3R lR\        4      pV! 4       V n        R# )Ú ÚPOSTÚasyncc                   ó.   <a € ] tR t^<t o V3R ltRtV tR# )Ú-AsyncXMLRPCTests.setUp.<locals>.AsyncResourcec                ó   <€ S# ©N© )ÚselfÚresults   &€Ú>/usr/lib/python3/dist-packages/twisted/web/test/test_xmlrpc.pyÚxmlrpc_asyncÚ:AsyncXMLRPCTests.setUp.<locals>.AsyncResource.xmlrpc_async=   s   ø€ Ø�ó    r)   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r-   Ú__static_attributes__Ú__classdictcell__)Ú__classdict__r+   s   @€r,   ÚAsyncResourcer&   <   s   ù‡ € ÷ó r/   r7   Nr)   )r   ÚrequestÚmethodr   r   r   ÚdumpsÚcontentr   ÚDeferredr+   r   Úresource)r*   r7   r+   s   & @r,   ÚsetUpÚAsyncXMLRPCTests.setUp3   sp   ø€ Ü# R DÓ)ˆŒØ$ˆ�‰ÔÜ'Ü˜w¬	¯ª¸Ó(;Ð<Õ<ó 
ˆ�‰Ôô  %Ÿ~š~Ó/Ð/ˆ�”÷	œFô 	ñ &›ˆŽr/   c                ó´  € V P                   P                  V P                  4       V P                  V P                  P                  . 4       V P
                  P                  R4       \        P                  ! RP                  V P                  P                  4      4      pV P                  VR4       V P                  V P                  P                  ^4       R# )z†
If an L{XMLRPC} C{xmlrpc_*} method returns a L{defer.Deferred}, the
response to the request is the result of that L{defer.Deferred}.
r+   r/   N))r+   N)r=   Úrenderr8   ÚassertEqualÚwrittenr+   Úcallbackr   ÚloadsÚjoinÚfinished)r*   Úresps   & r,   Útest_deferredResponseÚ&AsyncXMLRPCTests.test_deferredResponseB   s’   € ð
 	�‰×Ñ˜TŸ\™\Ô*Ø×Ñ˜Ÿ™×-Ñ-¨rÔ2à�‰×Ñ˜XÔ&ä�Š˜sŸx™x¨¯©×(<Ñ(<Ó=Ó>ˆØ×Ñ˜Ð2Ô3Ø×Ñ˜Ÿ™×.Ñ.°Ö2r/   c                óŽ  € V P                   P                  V P                  4       V P                  P                  \        P
                  ! \        R4      4      4       V P                  P                  R4       V P                  V P                  P                  . 4       V P                  V P                  P                  ^ 4       R# )zØ
While waiting for the L{Deferred} returned by an L{XMLRPC} C{xmlrpc_*}
method to fire, the connection the request was issued over may close.
If this happens, neither C{write} nor C{finish} is called on the
request.
Ú	Simulatedr+   N)r=   rA   r8   ÚprocessingFailedr   ÚFailurer   r+   rD   rB   rC   rG   ©r*   s   &r,   Ú test_interruptedDeferredResponseÚ1AsyncXMLRPCTests.test_interruptedDeferredResponseP   s€   € ð 	�‰×Ñ˜TŸ\™\Ô*Ø�‰×%Ñ%¤g§o¢o´nÀ[Ó6QÓ&RÔSØ�‰×Ñ˜XÔ&Ø×Ñ˜Ÿ™×-Ñ-¨rÔ2Ø×Ñ˜Ÿ™×.Ñ.°Ö2r/   )r8   r=   r+   N)
r0   r1   r2   r3   Ú__doc__r>   rI   rP   r4   r5   ©r6   s   @r,   r    r    .   s   ø‡ € ñò(ò3÷3ð 3r/   r    c                   ó   € ] tR t^^tRtR# )ÚTestRuntimeErrorr)   N©r0   r1   r2   r3   r4   r)   r/   r,   rU   rU   ^   ó   † Ûr/   rU   c                   ó   € ] tR t^btRtR# )ÚTestValueErrorr)   NrV   r)   r/   r,   rY   rY   b   rW   r/   rY   c                   óÀ   a € ] tR t^ft o Rt^t^*tR tR t. RO. RO.]n	        R t
. RO.]
n	        R tR tR tR tR	 tR
 tR tR tR]n        ]R 4       tR tRtV tR# )ÚTestéš  c                ó   € V# r(   r)   )r*   Úargs   &&r,   Úxmlrpc_echoÚTest.xmlrpc_echon   s   € Øˆ
r/   c                ó   € W,           # )z 
This function add two numbers.
r)   )r*   ÚaÚbs   &&&r,   Ú
xmlrpc_addÚTest.xmlrpc_addr   s   € ð �uˆr/   c                ó   € W.# )z3
This function puts the two arguments in an array.
r)   )r*   ÚstringÚnums   &&&r,   Úxmlrpc_pairÚTest.xmlrpc_pair~   s   € ð ˆ}Ðr/   c                ó.   € \         P                  ! V4      # )úHelp for defer.)r   Úsucceed©r*   Úxs   &&r,   Úxmlrpc_deferÚTest.xmlrpc_defer‡   s   € ä�}Š}˜QÓÐr/   c                ó>   € \         P                  ! \        4       4      # r(   )r   ÚfailrY   rO   s   &r,   Úxmlrpc_deferFailÚTest.xmlrpc_deferFail‹   s   € Ü�zŠzœ.Ó*Ó+Ð+r/   c                ó   € \         hr(   )rU   rO   s   &r,   Úxmlrpc_failÚTest.xmlrpc_fail�   s   € ÜÐr/   c                ó0   € \         P                  ! ^R4      # )é   Úhello©r   ÚFaultrO   s   &r,   Úxmlrpc_faultÚTest.xmlrpc_fault’   s   € Ü�|Š|˜B Ó(Ð(r/   c                óX   € \         P                  ! \        P                  ! ^R4      4      # )é   Úhi)r   rs   r   r}   rO   s   &r,   Úxmlrpc_deferFaultÚTest.xmlrpc_deferFault•   s   € Ü�zŠzœ&Ÿ,š, r¨4Ó0Ó1Ð1r/   c                óD   € RpW!8w  d   \         P                  ! ^R4      # V# )z(
Used to test that we can pass Unicode.
õ   â˜ƒzPayload not unicode snowmanr|   )r*   ÚpayloadÚsnowmans   && r,   Úxmlrpc_snowmanÚTest.xmlrpc_snowman˜   s&   € ð ˆØÔÜ—<’< Ð$AÓBÐBØˆr/   c                ó   € R RR^. .RR/# )rb   rc   ÚcÚDÚfoor)   rO   s   &r,   Úxmlrpc_complexÚTest.xmlrpc_complex¡   s   € Ø�c˜3  BÐ'¨¨eÐ4Ð4r/   c                ó   € W,          # r(   r)   )r*   ÚmapÚkeys   &&&r,   Úxmlrpc_dictÚTest.xmlrpc_dict¤   s	   € Ø�xˆr/   úHelp for dict.c                ó6   € VP                   R,           V,           # )z‰
A method decorated with L{withRequest} which can be called by
a test to verify that the request object really is passed as
an argument.
Ú )r9   )r*   r8   Úothers   &&&r,   Úxmlrpc_withRequestÚTest.xmlrpc_withRequest©   s$   € ð �N‰Nð õð õ	ð	
r/   c                óÔ   €  \         P                  ! W4      #   \        P                   d;    TP	                  R 4      '       d"   \        P
                  ! T P                  R4      hh i ; i)ÚSESSIONzSession non-existent/expired.)r   ÚlookupProcedurer   ÚNoSuchFunctionÚ
startswithr}   ÚSESSION_EXPIRED)r*   ÚprocedurePaths   &&r,   rž   ÚTest.lookupProcedure¹   s`   € ð	Ü×)Ò)¨$Ó>Ð>øÜ×$Ñ$ô 	Ø×'Ñ'¨	×2Ò2Ü—l’lØ×(Ñ(Ð*Ióð ð ð	ús   ‚ ˜+A'Á#A'r)   N©Úintr¥   r¥   ©Údoubler§   r§   ©Úarrayrg   r¥   )r0   r1   r2   r3   ÚFAILUREÚ	NOT_FOUNDr¡   r_   rd   Ú	signatureri   rp   rt   rw   r~   rƒ   r‰   r�   r”   Úhelpr   rš   rž   r4   r5   rS   s   @r,   r[   r[   f   s’   ø‡ € ð €GØ€IØ€Oòòò 	Ú&ð€JÔòò 8Ð8€KÔò ò,òò)ò2òò5òð (€KÔàñ
ó ð
÷	ð 	r/   r[   c                   ó0   a € ] tR t^Åt o RtR tR tRtV tR# )ÚTestLookupProcedurezq
This is a resource which customizes procedure lookup to be used by the tests
of support for this customization.
c                ó   € V# r(   r)   rn   s   &&r,   ÚechoÚTestLookupProcedure.echoË   s   € Øˆr/   c                ór   € VR8X  d   V P                   # \        P                  ! V P                  RV R24      h)z[
Lookup a procedure from a fixed set of choices, either I{echo} or
I{system.listeMethods}.
r±   z
procedure z
 not found)r±   r   rŸ   r«   )r*   ÚprocedureNames   &&r,   rž   Ú#TestLookupProcedure.lookupProcedureÎ   s;   € ð
 ˜FÔ"Ø—9‘9ÐÜ×#Ò#Ø�N‰N˜j¨¨°zÐBó
ð 	
r/   r)   N)	r0   r1   r2   r3   rR   r±   rž   r4   r5   rS   s   @r,   r¯   r¯   Å   s   ø‡ € ñò
÷	
ð 	
r/   r¯   c                   ó*   a € ] tR t^Út o RtR tRtV tR# )ÚTestListProcedureszv
This is a resource which customizes procedure enumeration to be used by the
tests of support for this customization.
c                ó   € R.# )zG
Return a list of a single method this resource will claim to support.
rŽ   r)   rO   s   &r,   ÚlistProceduresÚ!TestListProcedures.listProceduresà   s   € ð ˆwˆr/   r)   N)r0   r1   r2   r3   rR   r¹   r4   r5   rS   s   @r,   r·   r·   Ú   s   ø‡ € ñ÷
ð r/   r·   c                   ó6   a € ] tR t^çt o RtR tR tR tRtV t	R# )ÚTestAuthHeaderzI
This is used to get the header info so that we can test
authentication.
c                ó>   € \         P                  V 4       R V n        R # r(   )r[   Ú__init__r8   rO   s   &r,   r¾   ÚTestAuthHeader.__init__í   s   € Ü�‰�dÔØˆŽr/   c                ó8   € Wn         \        P                  W4      # r(   )r8   r[   rA   )r*   r8   s   &&r,   rA   ÚTestAuthHeader.renderñ   s   € ØŒÜ�{‰{˜4Ó)Ð)r/   c                ój   € V P                   P                  4       V P                   P                  4       3# r(   )r8   ÚgetUserÚgetPasswordrO   s   &r,   Úxmlrpc_authinfoÚTestAuthHeader.xmlrpc_authinfoõ   s'   € Ø�|‰|×#Ñ#Ó% t§|¡|×'?Ñ'?Ó'AÐAÐAr/   )r8   N)
r0   r1   r2   r3   rR   r¾   rA   rÅ   r4   r5   rS   s   @r,   r¼   r¼   ç   s    ø‡ € ñò
ò*÷Bð Br/   r¼   c                   ó6   a € ] tR t^ùt o RtR tR tR tRtV t	R# )ÚTestQueryProtocolzS
QueryProtocol for tests that saves headers received and sent,
inside the factory.
c                óz   € V P                   V P                  n         \        P                  P	                  V 4       R # r(   )Ú	transportÚfactoryr   ÚQueryProtocolÚconnectionMaderO   s   &r,   rÍ   Ú TestQueryProtocol.connectionMadeÿ   s&   € Ø!%§¡ˆ�‰ÔÜ×Ñ×+Ñ+¨DÖ1r/   c                óR   € W P                   P                  VP                  4       &   R # r(   )rË   ÚheadersÚlower©r*   r“   Úvals   &&&r,   ÚhandleHeaderÚTestQueryProtocol.handleHeader  s   € Ø,/�‰×Ñ˜SŸY™Y›[Ó)r/   c                ó’   € W P                   P                  VP                  4       &   \        P                  P                  WV4       R# )z1
Keep sent headers so we can inspect them later.
N)rË   Úsent_headersrÑ   r   rÌ   Ú
sendHeaderrÒ   s   &&&r,   rØ   ÚTestQueryProtocol.sendHeader  s2   € ð 25�‰×!Ñ! #§)¡)£+Ñ.Ü×Ñ×'Ñ'¨°3Ö7r/   r)   N)
r0   r1   r2   r3   rR   rÍ   rÔ   rØ   r4   r5   rS   s   @r,   rÈ   rÈ   ù   s   ø‡ € ñò
2ò0÷8ð 8r/   rÈ   c                   ó.   a € ] tR tRt o Rt]tR tRtV t	R# )ÚTestQueryFactoryi  z=
QueryFactory using L{TestQueryProtocol} for saving headers.
c                ój   € / V n         / V n        \        P                  P                  ! V .VO5/ VB  R # r(   )rÐ   r×   r   r   r¾   )r*   ÚargsÚkwargss   &*,r,   r¾   ÚTestQueryFactory.__init__  s/   € ØˆŒØˆÔÜ×Ñ×$Ò$ TÐ;¨DÒ;°FÔ;r/   )rÐ   r×   N)
r0   r1   r2   r3   rR   rÈ   Úprotocolr¾   r4   r5   rS   s   @r,   rÛ   rÛ     s   ø‡ € ñð !€H÷<ð <r/   rÛ   c                   ó*   a € ] tR tRt o RtR tRtV tR# )ÚTestQueryFactoryCanceli  zo
QueryFactory that saves a reference to the
L{twisted.internet.interfaces.IConnector} to test connection lost.
c                ó   € Wn         R # r(   ©Ú	connector)r*   rå   s   &&r,   ÚstartedConnectingÚ(TestQueryFactoryCancel.startedConnecting!  s   € Ø"Žr/   rä   N)r0   r1   r2   r3   rR   ræ   r4   r5   rS   s   @r,   râ   râ     s   ø‡ € ñ÷
#ð #r/   râ   c                   ó–   a € ] tR tRt o R tR tR tRR ltR tR t	R	 t
R
 tR tR tR tR tR tR t]! ]R4      R 4       tRtV tR# )ÚXMLRPCTestsi%  c                óÚ   € \         P                  ! ^ \        P                  ! \	        4       4      RR7      V n        V P
                  P                  4       P                  V n        . V n        R# ©é    ú	127.0.0.1©Ú	interfaceN)	r   Ú	listenTCPr   ÚSiter[   ÚpÚgetHostÚportÚ	factoriesrO   s   &r,   r>   ÚXMLRPCTests.setUp&  sB   € Ü×"Ò" 1¤f§k¢k´$³&Ó&9À[ÔQˆŒØ—F‘F—N‘NÓ$×)Ñ)ˆŒ	ØˆŽr/   c                óD   € . V n         V P                  P                  4       # r(   )rõ   rò   ÚstopListeningrO   s   &r,   ÚtearDownÚXMLRPCTests.tearDown+  s   € ØˆŒØ�v‰v×#Ñ#Ó%Ð%r/   c                óR   € \        V/ VB pV P                  P                  V4       V# )z_
Specific queryFactory for proxy that uses our custom
L{TestQueryFactory}, and save factories.
)rÛ   rõ   Úappend)r*   rÝ   rÞ   rË   s   &*, r,   ÚqueryFactoryÚXMLRPCTests.queryFactory/  s*   € ô
 # DÐ3¨FÑ3ˆØ�‰×Ñ˜gÔ&Øˆr/   Nc                ó    € \         P                  ! \        RV P                  ,          4      4      pVf   V P                  Vn        V# Wn        V# )zž
Return a new xmlrpc.Proxy for the test site created in
setUp(), using the given factory as the queryFactory, or
self.queryFactory if no factory is provided.
úhttp://127.0.0.1:%d/©r   ÚProxyr   rô   rý   ©r*   rË   rò   s   && r,   ÚproxyÚXMLRPCTests.proxy8  sF   € ô �LŠLœÐ'=ÀÇ	Á	Õ'IÓJÓKˆØŠ?Ø!×.Ñ.ˆAŒNð ˆð %ŒNØˆr/   c                ó*  € RRRR^/R3^3RRR^.3RRRRRR^. .RR/3.p. pV FU  w  r4pV P                  4       P                  ! V.VO5!  pVP                  V P                  V4       VP	                  V4       KW  	  \
        P                  ! VR	R
7      # )Úaddrb   ÚdictÚpairÚcomplexrc   rŒ   r�   rŽ   T©ÚfireOnOneErrback)r  )é   é   é   )r   )rb   rb   )rb   é   )rˆ   r†   r†   r)   ©r  Ú
callRemoteÚaddCallbackrB   rü   r   ÚDeferredList)r*   ÚinputOutputÚdlÚmethrÝ   ÚoutpÚds   &      r,   Útest_resultsÚXMLRPCTests.test_resultsE  s³   € àØ"Ø�s˜A�h �_ aÐ(Ø�X  Q˜xÐ(Ø-Ø˜˜S 3¨¨R°Ð"4°c¸5ÐAÐBð
ˆð ˆÛ +ÑˆD˜Ø—
‘
“×'Ò'¨Ð4¨tÓ4ˆAØ�M‰M˜$×*Ñ*¨DÔ1Ø�I‰I�aŽLñ !,ô ×!Ò! "°tÔ<Ð<r/   c                ó¤   a € S P                  4       P                  RR4      pV 3R lpV 3R lpVP                  V4       VP                  V4       V# )zk
Verify that headers sent from the client side and the ones we
get back from the server side are correct.

rˆ   r†   c                 óØ   <€ SP                  SP                  ^ ,          P                  R,          R4       SP                  SP                  ^ ,          P                  R,          R4       R# )rì   ó   content-typeó   text/xml; charset=utf-8ó   content-lengths   129N)rB   rõ   rÐ   )Úingr*   s   &€r,   Úcheck_server_headersÚ6XMLRPCTests.test_headers.<locals>.check_server_headers^  sR   ø€ Ø×ÑØ—‘˜qÕ!×)Ñ)¨/Õ:Ð<Vôð ×Ñ˜TŸ^™^¨AÕ.×6Ñ6Ð7HÕIÈ6ÖRr/   c                 ó@  <€ SP                  SP                  ^ ,          P                  R,          R4       SP                  SP                  ^ ,          P                  R,          R4       SP                  SP                  ^ ,          P                  R,          R4       R# )rì   s
   user-agents   Twisted/XMLRPClibr  r  r   s   155N)rB   rõ   r×   )Úignr*   s   &€r,   Úcheck_client_headersÚ6XMLRPCTests.test_headers.<locals>.check_client_headersd  s}   ø€ Ø×ÑØ—‘˜qÕ!×.Ñ.¨}Õ=Ð?Sôð ×ÑØ—‘˜qÕ!×.Ñ.¨Õ?Ø*ôð ×Ñ˜TŸ^™^¨AÕ.×;Ñ;Ð<MÕNÐPVÖWr/   ©r  r  r  )r*   r  r"  r&  s   f   r,   Útest_headersÚXMLRPCTests.test_headersV  sJ   ø€ ð �J‰J‹L×#Ñ# I¨xÓ8ˆõ	Sõ	Xð 	
�‰Ð*Ô+Ø	�‰Ð*Ô+Øˆr/   c                ó
  a aa€ \        4       o\        S\        \        P                  R7      .4      o\
        P                  ! S4       S P                  V3R l4       . pR Fm  w  r#S P                  4       P                  V4      pS P                  V\        P                  4      pVP                  V3V 3R ll4       VP                  V4       Ko  	  \        P                   ! VRR7      pVV 3R lpVP                  V4       V# )zÐ
Verify that for each way a method exposed via XML-RPC can fail, the
correct 'Content-type' header is set in the response and that the
client-side Deferred is errbacked with an appropriate C{Fault}
instance.
©ÚdefaultLogLevelc                  ó0   <€ \         P                  ! S 4      # r(   ©r   ÚremoveObserver©Úfiltereds   €r,   Ú<lambda>Ú)XMLRPCTests.test_errors.<locals>.<lambda>~  ó   ø€ Ô 2× AÒ AÀ(Ô Kr/   c                 ó<   <€ SP                  V P                  V4      # r(   )rB   Ú	faultCode)ÚexcÚcoder*   s   &&€r,   r3  r4  Š  s   ø€ °×1AÑ1AÀ#Ç-Á-ÐQUÔ1Vr/   Tr  c                 óø  <€ SP                    F&  pSP                  VP                  R ,          R4       K(  	  SP                  ^\	        S4      4       S^ ,          R,          P
                  pS^,          R,          P
                  p\        V\        4      '       d   SP                  V\        4       M,SP                  V\        4       SP                  V\        4       SP                  \        \        4       R# )r  r  Úlog_failureN)rõ   rB   rÐ   ÚassertEqualsÚlenÚvalueÚ
isinstancerY   ÚassertIsInstancerU   ÚflushLoggedErrors)r%  rË   Úf1Úf2ÚlogObserverr*   s   &   €€r,   ÚcbÚ#XMLRPCTests.test_errors.<locals>.cbŽ  s½   ø€ ØŸ>œ>�Ø× Ñ Ø—O‘O OÕ4Ð6Pöñ *ð ×Ñ˜a¤ [Ó!1Ô2Ø˜Q• Õ.×4Ñ4ˆBØ˜Q• Õ.×4Ñ4ˆBä˜"œn×-Ò-Ø×%Ñ% bÔ*:Õ;à×%Ñ% bÔ*:Ô;Ø×%Ñ% b¬.Ô9à×"Ñ"Ô#3´^ÖDr/   ))r\   rs   )r\   Ú	deferFail)rz   Úfault)é   ÚnoSuchMethod)r�   Ú
deferFault)é*   ÚSESSION_TEST)r   r
   r   r   Úcriticalr   ÚaddObserverÚ
addCleanupr  r  ÚassertFailurer   r}   r  rü   r   r  )r*   r  r9  Ú
methodNamer  rE  r2  rD  s   f     @@r,   Útest_errorsÚXMLRPCTests.test_errorsr  sÑ   ú€ ô +Ó,ˆÜ'ØÔ1Ä(×BSÑBSÔTÐUó
ˆô 	×&Ò& xÔ0Ø�‰ÔKÔLØˆó!
ÑˆDð —
‘
“×'Ñ'¨
Ó3ˆAØ×"Ñ" 1¤f§l¡lÓ3ˆAØ�M‰M¨4ÖVÔWØ�I‰I�aŽLñ!
ô ×Ò˜r°DÔ9ˆö	Eð" 	
�‰�bÔØˆr/   c                óx  a€ V3R loV P                  S4      P                  R^^4      pV P                  SP                  P                  P
                  R4       VP                  4        V P                  SP                  P                  P
                  R4       V P                  V\        P                  4      pV# )zj
A deferred from the Proxy can be cancelled, disconnecting
the L{twisted.internet.interfaces.IConnector}.
c                  ó<   <€ \        V / VB Sn        SP                  # r(   )râ   Úf)rÝ   ÚkwrË   s   *,€r,   rË   Ú(XMLRPCTests.test_cancel.<locals>.factory¨  s   ø€ Ü.°Ð;¸Ñ;ˆGŒIØ—9‘9Ðr/   r  Údisconnected)r  r  ÚassertNotEqualrW  rå   ÚstateÚcancelrB   rQ  r   ÚCancelledError)r*   r  rË   s   & @r,   Útest_cancelÚXMLRPCTests.test_cancel¢  s�   ø€ õ	ð �J‰J�wÓ×*Ñ*¨5°!°QÓ7ˆØ×Ñ˜GŸI™I×/Ñ/×5Ñ5°~ÔFØ	�‰Œ
Ø×Ñ˜Ÿ™×,Ñ,×2Ñ2°NÔCØ×Ñ˜q¤%×"6Ñ"6Ó7ˆØˆr/   c                óÄ   a € \         P                  ! \        4      pVP                  R\	        RS P
                  3,          4      4      pV 3R lpVP                  V4       V# )z>
A classic GET on the xml server should return a NOT_ALLOWED.
s   GETr   c                 ó\   <€ SP                  V P                  \        P                  4       R # r(   )rB   r9  r   ÚNOT_ALLOWED)Úresponser*   s   &€r,   ÚcheckResponseÚ0XMLRPCTests.test_errorGet.<locals>.checkResponseº  s   ø€ Ø×Ñ˜XŸ]™]¬D×,<Ñ,<Ö=r/   )r   ÚAgentr   r8   r   rô   r  )r*   Úagentr  re  s   f   r,   Útest_errorGetÚXMLRPCTests.test_errorGet³  sL   ø€ ô —’œWÓ%ˆØ�M‰M˜&¤-Ð0FÈ$Ï)É)ÈÕ0UÓ"VÓWˆõ	>ð 	
�‰�mÔ$Øˆr/   c           	     ó@  a € \         P                  ! \        4      pVP                  \	        RS P
                  3,          4      R\         P                  ! \        R4      4      R7      pVP                  \         P                  4       V 3R lpVP                  V4       V# )z<
Test that an invalid XML input returns an L{xmlrpc.Fault}.
r   s   POSTs   foo)Úurir9   ÚbodyProducerc                 óf   <€ SP                  \        P                  \        P                  V 4       R # r(   )ÚassertRaisesr   r}   r   rE   )r+   r*   s   &€r,   rE  Ú,XMLRPCTests.test_errorXMLContent.<locals>.cbÌ  s   ø€ Ø×ÑœfŸl™l¬I¯O©O¸VÖDr/   )
r   rg  r   r8   r   rô   ÚFileBodyProducerr   r  ÚreadBody)r*   rh  r  rE  s   f   r,   Útest_errorXMLContentÚ XMLRPCTests.test_errorXMLContentÀ  sz   ø€ ô —’œWÓ%ˆØ�M‰MÜÐ4¸¿	¹	°|ÕCÓDØÜ×0Ò0´¸³ÓAð ó 
ˆð
 	
�‰”f—o‘oÔ&õ	Eð 	
�‰�bÔØˆr/   c                ó¨   € \         P                  ! 4       pV P                  4       P                  RV4      pVP	                  V P
                  V4       V# )z¨
If an L{xmlrpclib.DateTime} is passed as an argument to an XML-RPC
call and then returned by the server unmodified, the result should
be equal to the original object.
r±   )r   ÚDateTimer  r  r  rB   )r*   Úwhenr  s   &  r,   Útest_datetimeRoundtripÚ"XMLRPCTests.test_datetimeRoundtripÒ  sC   € ô ×!Ò!Ó#ˆØ�J‰J‹L×#Ñ# F¨DÓ1ˆØ	�‰�d×&Ñ&¨Ô-Øˆr/   c                ó�  a aa€ \        4       o\        S\        \        P                  R7      .4      o\
        P                  ! S4       S P                  V3R l4       S P                  4       P                  RR4      pR pS P                  \        RV4       S P                  V\        4      pVV 3R lpVP                  V4       V# )a  
If it is not possible to encode a response to the request (for example,
because L{xmlrpclib.dumps} raises an exception when encoding a
L{Fault}) the exception which prevents the response from being
generated is logged and the request object is finished anyway.
r,  c                  ó0   <€ \         P                  ! S 4      # r(   r/  r1  s   €r,   r3  Ú6XMLRPCTests.test_doubleEncodingError.<locals>.<lambda>é  r5  r/   r±   r"   c                  ó   € \        R 4      h)zCannot encode anything at all!)ÚRuntimeError)rÝ   rÞ   s   *,r,   Ú	fakeDumpsÚ7XMLRPCTests.test_doubleEncodingError.<locals>.fakeDumpsí  s   € ÜÐ?Ó@Ð@r/   r:   c                 óö   <€ SP                  ^\        S4      4       SP                  S^ ,          R,          P                  \        4       SP                  \        SP                  \        4      4      ^4       R# )r  r;  N)r<  r=  r@  r>  r~  rB   rA  )ÚignoredrD  r*   s   &€€r,   ÚcbFailedÚ6XMLRPCTests.test_doubleEncodingError.<locals>.cbFailed÷  sW   ø€ à×Ñ˜a¤ [Ó!1Ô2Ø×!Ñ! +¨a¥.°Õ"?×"EÑ"EÄ|ÔTØ×ÑœS ×!7Ñ!7¼Ó!EÓFÈÖJr/   )r   r
   r   r   rN  r   rO  rP  r  r  Úpatchr   rQ  Ú	Exceptionr  )r*   r  r  rƒ  r2  rD  s   f   @@r,   Útest_doubleEncodingErrorÚ$XMLRPCTests.test_doubleEncodingErrorÝ  s¥   ú€ ô +Ó,ˆÜ'ØÔ1Ä(×BSÑBSÔTÐUó
ˆô 	×&Ò& xÔ0Ø�‰ÔKÔLØ�J‰J‹L×#Ñ# F¨BÓ/ˆò	Að 	�
‰
”9˜g yÔ1ð
 ×Ñ˜q¤)Ó,ˆö	Kð 	
�‰�hÔØˆr/   c                ór   a € S P                  4       P                  RR4      pV 3R lpVP                  V4      # )zF
The connection to the web server is closed when the request is done.
r±   r"   c                 ó¸   <€ SP                   w  pSP                  VP                  P                  4       SP	                  VP                  P
                  4       R # r(   )rõ   ÚassertFalserÊ   Ú	connectedÚ
assertTruerZ  )r‚  rË   r*   s   & €r,   ÚresponseDoneÚBXMLRPCTests.test_closeConnectionAfterRequest.<locals>.responseDone  s@   ø€ ØŸ™‰IˆWØ×Ñ˜W×.Ñ.×8Ñ8Ô9Ø�O‰O˜G×-Ñ-×:Ñ:Ö;r/   r(  )r*   r  rŽ  s   f  r,   Ú test_closeConnectionAfterRequestÚ,XMLRPCTests.test_closeConnectionAfterRequest   s3   ø€ ð �J‰J‹L×#Ñ# F¨BÓ/ˆõ	<ð
 �}‰}˜\Ó*Ð*r/   c                óÂ   € \        4       p\        P                  ! RRVR7      pVP                  R4       V P	                  VP
                  ^ ,          ^,          R4       R# )z­
For I{HTTP} URIs, L{xmlrpc.Proxy.callRemote} passes the value it
received for the C{connectTimeout} parameter as the C{timeout} argument
to the underlying connectTCP call.
s   http://127.0.0.1:69g       @©ÚconnectTimeoutr   Ú
someMethodN)r	   r   r  r  rB   Ú
tcpClients©r*   r   r  s   &  r,   Útest_tcpTimeoutÚXMLRPCTests.test_tcpTimeout  sP   € ô  “/ˆÜ—’Ø"°3Àô
ˆð 	×Ñ˜Ô&Ø×Ñ˜×+Ñ+¨AÕ.¨qÕ1°3Ö7r/   zOpenSSL not presentc                óÂ   € \        4       p\        P                  ! RRVR7      pVP                  R4       V P	                  VP
                  ^ ,          ^,          R4       R# )z®
For I{HTTPS} URIs, L{xmlrpc.Proxy.callRemote} passes the value it
received for the C{connectTimeout} parameter as the C{timeout} argument
to the underlying connectSSL call.
s   https://127.0.0.1:69g      @r“  r•  N)r	   r   r  r  rB   Ú
sslClientsr—  s   &  r,   Útest_sslTimeoutÚXMLRPCTests.test_sslTimeout  sP   € ô  “/ˆÜ—’Ø#°CÀô
ˆð 	×Ñ˜Ô&Ø×Ñ˜×+Ñ+¨AÕ.¨qÕ1°3Ö7r/   ©rõ   rò   rô   r(   )r0   r1   r2   r3   r>   rù   rý   r  r  r)  rS  r_  ri  rs  rx  r‡  r�  r˜  r   ÚsslSkiprœ  r4   r5   rS   s   @r,   ré   ré   %  si   ø‡ € òò
&òôò=ò"ò8.ò`ò"òò$	ò!òF+ò8ñ ˆGÐ*Ó+ñ8ó ,ö8r/   ré   c                   ó.   a € ] tR tRt o RtRR ltRtV tR# )ÚXMLRPCProxyWithoutSlashTestsi)  z+
Test with proxy that doesn't add a slash.
Nc                ó    € \         P                  ! \        R V P                  ,          4      4      pVf   V P                  Vn        V# Wn        V# )úhttp://127.0.0.1:%dr  r  s   && r,   r  Ú"XMLRPCProxyWithoutSlashTests.proxy.  sD   € Ü�LŠLœÐ'<¸t¿y¹yÕ'HÓIÓJˆØŠ?Ø!×.Ñ.ˆAŒNð ˆð %ŒNØˆr/   r)   r(   )r0   r1   r2   r3   rR   r  r4   r5   rS   s   @r,   r¡  r¡  )  s   ø‡ € ñ÷ò r/   r¡  c                   ó<   a € ] tR tRt o RtR tR tR tR tRt	V t
R# )	Ú XMLRPCPublicLookupProcedureTestsi7  zf
Tests for L{XMLRPC}'s support of subclasses which override
C{lookupProcedure} and C{listProcedures}.
c                óp  € \         P                  ! ^ \        P                  ! V4      RR7      V n        V P                  V P                  P                  4       V P                  P                  4       P                  V n        \        P                  ! \        RV P                  ,          4      4      V n        R# )rì   rí   rî   r£  N)r   rð   r   rñ   rò   rP  rø   ró   rô   r   r  r   r  )r*   r=   s   &&r,   ÚcreateServerÚ-XMLRPCPublicLookupProcedureTests.createServer=  sn   € Ü×"Ò" 1¤f§k¢k°(Ó&;À{ÔSˆŒØ�‰˜Ÿ™×,Ñ,Ô-Ø—F‘F—N‘NÓ$×)Ñ)ˆŒ	Ü—\’\¤-Ð0EÈÏ	É	Õ0QÓ"RÓSˆŽ
r/   c                ó¬   € V P                  \        4       4       RpV P                  P                  RV4      pVP	                  V P
                  V4       V# )zŠ
A subclass of L{XMLRPC} can override C{lookupProcedure} to find
procedures that are not defined using a C{xmlrpc_}-prefixed method name.
r{   r±   )r¨  r¯   r  r  r  rB   )r*   Úwhatr  s   &  r,   Útest_lookupProcedureÚ5XMLRPCPublicLookupProcedureTests.test_lookupProcedureC  sJ   € ð
 	×ÑÔ-Ó/Ô0ØˆØ�J‰J×!Ñ! &¨$Ó/ˆØ	�‰�d×&Ñ&¨Ô-Øˆr/   c                ó°   € V P                  \        4       4       V P                  P                  RR4      pV P	                  V\
        P                  4      pV# )zÁ
A subclass of L{XMLRPC} can override C{lookupProcedure} to raise
L{NoSuchFunction} to indicate that a requested method is not available
to be called, signalling a fault to the XML-RPC client.
Úxxxxr{   )r¨  r¯   r  r  rQ  r   r}   ©r*   r  s   & r,   rS  Ú,XMLRPCPublicLookupProcedureTests.test_errorsN  sG   € ð 	×ÑÔ-Ó/Ô0Ø�J‰J×!Ñ! &¨'Ó2ˆØ×Ñ˜q¤&§,¡,Ó/ˆØˆr/   c                ó¸   a € \        4       p\        V4       S P                  V4       S P                  P	                  R4      pV 3R lpVP                  V4       V# )zŒ
A subclass of L{XMLRPC} can override C{listProcedures} to define
Overriding listProcedures should prevent introspection from being
broken.
úsystem.listMethodsc                 ó,   <€ SP                  R V 4       R# )rŽ   N)ÚassertIn)Ú
proceduresr*   s   &€r,   ÚlistedÚAXMLRPCPublicLookupProcedureTests.test_listMethods.<locals>.listedd  s   ø€ ð �M‰M˜% Ö,r/   )r·   r   r¨  r  r  r  )r*   r=   r  r·  s   f   r,   Útest_listMethodsÚ1XMLRPCPublicLookupProcedureTests.test_listMethodsY  sP   ø€ ô &Ó'ˆÜ˜Ô"Ø×Ñ˜(Ô#Ø�J‰J×!Ñ!Ð"6Ó7ˆõ	-ð 	
�‰�fÔØˆr/   ©rò   rô   r  N)r0   r1   r2   r3   rR   r¨  r¬  rS  r¹  r4   r5   rS   s   @r,   r¦  r¦  7  s$   ø‡ € ñò
Tò	ò	÷ð r/   r¦  c                   ó6   a € ] tR tRt o RtR tR tR tRtV t	R# )ÚSerializationConfigMixinin  aK  
Mixin which defines a couple tests which should pass when a particular flag
is passed to L{XMLRPC}.

These are not meant to be exhaustive serialization tests, since L{xmlrpclib}
does all of the actual serialization work.  They are just meant to exercise
a few codepaths to make sure we are calling into xmlrpclib correctly.

@ivar flagName: A C{str} giving the name of the flag which must be passed to
    L{XMLRPC} to allow the tests to pass.  Subclasses should set this.

@ivar value: A value which the specified flag will allow the serialization
    of.  Subclasses should set this.
c           
     ó¢  € V P                   R/p\        P                  ! ^ \        P                  ! \        R/ VB 4      RR7      V n        V P                  V P                  P                  4       V P                  P                  4       P                  V n
        \        P                  ! \        RV P                  3,          4      3/ VB V n        R# )z?
Create a new XML-RPC server with C{allowNone} set to C{True}.
Trí   rî   r   Nr)   )ÚflagNamer   rð   r   rñ   r[   rò   rP  rø   ró   rô   r   r  r   r  )r*   rÞ   s   & r,   r>   ÚSerializationConfigMixin.setUp~  s–   € ð —-‘- Ð&ˆÜ×"Ò"ØŒv�{Š{œ4™> &™>Ó*°kô
ˆŒð 	�‰˜Ÿ™×,Ñ,Ô-Ø—F‘F—N‘NÓ$×)Ñ)ˆŒ	Ü—\’\ÜÐ0°D·I±I°<Õ?Ó@ñ
ØDJñ
ˆŽ
r/   c                óž   € V P                   P                  RV P                  4      pVP                  V P                  V P                  4       V# )zI
C{self.value} can be round-tripped over an XMLRPC method call/response.
r   ©r  r  r>  r  rB   r°  s   & r,   Útest_roundtripValueÚ,SerializationConfigMixin.test_roundtripValueŒ  s;   € ð �J‰J×!Ñ! '¨4¯:©:Ó6ˆØ	�‰�d×&Ñ&¨¯
©
Ô3Øˆr/   c                ó¦   € V P                   P                  RRV P                  /4      pVP                  V P                  RV P                  /4       V# )zb
A C{dict} which contains C{self.value} can be round-tripped over an
XMLRPC method call/response.
r   rb   rÂ  r°  s   & r,   Útest_roundtripNestedValueÚ2SerializationConfigMixin.test_roundtripNestedValue”  sE   € ð
 �J‰J×!Ñ! '¨C°·±Ð+<Ó=ˆØ	�‰�d×&Ñ&¨¨d¯j©jÐ(9Ô:Øˆr/   r»  N)
r0   r1   r2   r3   rR   r>   rÃ  rÆ  r4   r5   rS   s   @r,   r½  r½  n  s   ø‡ € ñò
ò÷ð r/   r½  c                   ó"   € ] tR tRtRtRtRtRtR# )ÚXMLRPCAllowNoneTestsiž  z>
Tests for passing L{None} when the C{allowNone} flag is set.
Ú	allowNoneNr)   )r0   r1   r2   r3   rR   r¿  r>  r4   r)   r/   r,   rÉ  rÉ  ž  s   † ñð €HØ„Er/   rÉ  c                   óL   € ] tR tRtRtRt]P                  ! R^^^^-^;4      tRtR# )ÚXMLRPCUseDateTimeTestsi§  zX
Tests for passing a C{datetime.datetime} instance when the C{useDateTime}
flag is set.
ÚuseDateTimeiÐ  r)   N)	r0   r1   r2   r3   rR   r¿  Údatetimer>  r4   r)   r/   r,   rÌ  rÌ  §  s(   † ñð
 €HØ×Ò˜d B¨¨A¨r°2Ó6„Er/   rÌ  c                   óJ   a € ] tR tRt o RtRtRtR tR tR t	R t
R	 tR
tV tR# )ÚXMLRPCAuthenticatedTestsi±  zQ
Test with authenticated proxy. We run this with the same input/output as
above.
s   usernames   asecretc                óÚ   € \         P                  ! ^ \        P                  ! \	        4       4      RR7      V n        V P
                  P                  4       P                  V n        . V n        R# rë   )	r   rð   r   rñ   r¼   rò   ró   rô   rõ   rO   s   &r,   r>   ÚXMLRPCAuthenticatedTests.setUpº  sH   € Ü×"Ò"ØŒv�{Š{œ>Ó+Ó,¸ô
ˆŒð —F‘F—N‘NÓ$×)Ñ)ˆŒ	ØˆŽr/   c                óB  € R \        V P                  4      \        V P                  4      V P                  3,          p\        P
                  ! \        V4      4      pVP                  R4      pVP                  V P                  V P                  V P                  .4       V# )zhttp://%s:%s@127.0.0.1:%d/Úauthinfo)
r   ÚuserÚpasswordrô   r   r  r   r  r  rB   )r*   Úurlrò   r  s   &   r,   Útest_authInfoInURLÚ+XMLRPCAuthenticatedTests.test_authInfoInURLÁ  sy   € Ø*Ü˜Ÿ™Ó#Ü˜Ÿ™Ó'Ø�I‰Ið.
õ 
ˆô
 �LŠLœ sÓ+Ó,ˆØ�L‰L˜Ó$ˆØ	�‰�d×&Ñ&¨¯©°D·M±MÐ(BÔCØˆr/   c                ó  € \         P                  ! \        R V P                  3,          4      V P                  V P
                  4      pVP                  R4      pVP                  V P                  V P                  V P
                  .4       V# )r   rÔ  ©	r   r  r   rô   rÕ  rÖ  r  r  rB   ©r*   rò   r  s   &  r,   Útest_explicitAuthInfoÚ.XMLRPCAuthenticatedTests.test_explicitAuthInfoÌ  sh   € Ü�LŠLÜÐ0°D·I±I°<Õ?Ó@Ø�I‰IØ�M‰Mó
ˆð
 �L‰L˜Ó$ˆØ	�‰�d×&Ñ&¨¯©°D·M±MÐ(BÔCØˆr/   c                ó  € V P                   ^(,          p\        P                  ! \        RV P                  3,          4      V P
                  V4      pVP                  R4      pVP                  V P                  V P
                  V.4       V# )z´
C{QueryProtocol} uses the C{base64.b64encode} function to encode user
name and password in the I{Authorization} header, so that it doesn't
embed new lines when using long inputs.
r   rÔ  )	rÖ  r   r  r   rô   rÕ  r  r  rB   )r*   ÚlongPasswordrò   r  s   &   r,   Útest_longPasswordÚ*XMLRPCAuthenticatedTests.test_longPasswordÖ  sp   € ð —}‘} rÕ)ˆÜ�LŠLÜÐ0°D·I±I°<Õ?Ó@Ø�I‰IØó
ˆð
 �L‰L˜Ó$ˆØ	�‰�d×&Ñ&¨¯©°LÐ(AÔBØˆr/   c                ó  € \         P                  ! \        R V P                  3,          4      V P                  V P
                  4      pVP                  R4      pVP                  V P                  V P                  V P
                  .4       V# )zhttp://wrong:info@127.0.0.1:%d/rÔ  rÛ  rÜ  s   &  r,   Útest_explicitAuthInfoOverrideÚ6XMLRPCAuthenticatedTests.test_explicitAuthInfoOverrideæ  sh   € Ü�LŠLÜÐ;¸t¿y¹y¸lÕJÓKØ�I‰IØ�M‰Mó
ˆð
 �L‰L˜Ó$ˆØ	�‰�d×&Ñ&¨¯©°D·M±MÐ(BÔCØˆr/   rž  N)r0   r1   r2   r3   rR   rÕ  rÖ  r>   rØ  rÝ  rá  rä  r4   r5   rS   s   @r,   rÐ  rÐ  ±  s4   ø‡ € ñð
 €DØ€Hòò	òò÷ ð r/   rÐ  c                   ó8   a € ] tR tRt o R tR tR tR tRtV t	R# )ÚXMLRPCIntrospectionTestsiñ  c                óô   € \        4       p\        V4       \        P                  ! ^ \        P
                  ! V4      RR7      V n        V P                  P                  4       P                  V n        . V n	        R# rë   )
r[   r   r   rð   r   rñ   rò   ró   rô   rõ   )r*   r   s   & r,   r>   ÚXMLRPCIntrospectionTests.setUpò  sO   € Ü“ˆÜ˜Ô Ü×"Ò" 1¤f§k¢k°&Ó&9À[ÔQˆŒØ—F‘F—N‘NÓ$×)Ñ)ˆŒ	ØˆŽr/   c                ót   a € V 3R  lpS P                  4       P                  R4      pVP                  V4       V# )c                 óP   <€ V P                  4        SP                  V . RO4       R# )r  N)r  r
  r   rG  rK  r  r±   rs   rH  r	  rˆ   r³  úsystem.methodHelpúsystem.methodSignaturer   )ÚsortrB   )Úmethsr*   s   &€r,   Ú	cbMethodsÚ<XMLRPCIntrospectionTests.test_listMethods.<locals>.cbMethodsú  s"   ø€ Ø�J‰JŒLØ×ÑØòör/   r³  r(  )r*   rð  r  s   f  r,   r¹  Ú)XMLRPCIntrospectionTests.test_listMethodsù  s2   ø€ õ	ð. �J‰J‹L×#Ñ#Ð$8Ó9ˆØ	�‰�iÔ Øˆr/   c                óî   € . ROp. pV FR  w  r4V P                  4       P                  RV4      pVP                  V P                  V4       VP	                  V4       KT  	  \
        P                  ! VRR7      # )r   rì  Tr  ))r   rl   )rs   r"   )r  r–   r  ©r*   ÚinputOutputsr  r  Úexpectedr  s   &     r,   Útest_methodHelpÚ(XMLRPCIntrospectionTests.test_methodHelp  si   € ò
ˆð ˆÛ*‰NˆDØ—
‘
“×'Ñ'Ð(;¸TÓBˆAØ�M‰M˜$×*Ñ*¨HÔ5Ø�I‰I�aŽLñ +ô ×!Ò! "°tÔ<Ð<r/   c                ó
  € RR. RO. RO.3R. R	O.3.p. pV FR  w  r4V P                  4       P                  RV4      pVP                  V P                  V4       VP	                  V4       KT  	  \
        P                  ! VRR7      # )
r   r  r	  rí  Tr  )r   r"   r¤   r¦   r¨   r  rô  s   &     r,   Útest_methodSignatureÚ-XMLRPCIntrospectionTests.test_methodSignature#  s‡   € àØÒ*Ò,JÐKÐLØÒ0Ð1Ð2ð
ˆð ˆÛ*‰NˆDØ—
‘
“×'Ñ'Ð(@À$ÓGˆAØ�M‰M˜$×*Ñ*¨HÔ5Ø�I‰I�aŽLñ +ô ×!Ò! "°tÔ<Ð<r/   rž  N)
r0   r1   r2   r3   r>   r¹  r÷  rú  r4   r5   rS   s   @r,   rç  rç  ñ  s   ø‡ € òòò8=÷=ð =r/   rç  c                   ó6   a € ] tR tRt o RtR tR tR tRtV t	R# )ÚXMLRPCClientErrorHandlingTestsi2  z+
Test error handling on the xmlrpc client.
c                óØ   € \         P                  ! R R4      V n        RV P                  n        \        P
                  ! ^ \        P                  ! V P                  4      RR7      V n        R# )s*   This text is not a valid XML-RPC response.s
   text/plainTrí   rî   N)	r   ÚDatar=   ÚisLeafr   rð   r   rñ   rô   rO   s   &r,   r>   Ú$XMLRPCClientErrorHandlingTests.setUp7  sK   € ÜŸšØ9¸=ó
ˆŒð  $ˆ�‰Ôä×%Ò%ØŒv�{Š{˜4Ÿ=™=Ó)°[ô
ˆŽ	r/   c                ó6   € V P                   P                  4       # r(   )rô   rø   rO   s   &r,   rù   Ú'XMLRPCClientErrorHandlingTests.tearDownA  s   € Ø�y‰y×&Ñ&Ó(Ð(r/   c                óÞ   € \         P                  ! \        RV P                  P	                  4       P                  3,          4      4      pV P                  VP                  R4      \        4      # )zR
Test that calling the xmlrpc client on a static http server raises
an exception.
r   r•  )r   r  r   rô   ró   rQ  r  Ú
ValueError)r*   r  s   & r,   Útest_erroneousResponseÚ5XMLRPCClientErrorHandlingTests.test_erroneousResponseD  sV   € ô
 —’ÜÐ0°D·I±I×4EÑ4EÓ4G×4LÑ4LÐ3NÕNÓOó
ˆð ×!Ñ! %×"2Ñ"2°<Ó"@Ä*ÓMÐMr/   )rô   r=   N)
r0   r1   r2   r3   rR   r>   rù   r  r4   r5   rS   s   @r,   rý  rý  2  s    ø‡ € ñò
ò)÷Nð Nr/   rý  c                   óB   a € ] tR tRt o RtR tR tR tR tR t	Rt
V tR	# )
ÚQueryFactoryParseResponseTestsiO  z6
Test the behaviour of L{QueryFactory.parseResponse}.
c           
     ó¾   € \        R R RR R RRR7      V n        \        P                  ! R4      V n        RV n        \        P                  ! \        4       4      V n	        R # )Nr#   F)ÚpathÚhostr9   rÕ  rÖ  rÊ  rÝ   zinvalid xmlr)   )r"   )
r   rý   r   r:   ÚgoodContentsÚbadContentsr   rN   r   ÚreasonrO   s   &r,   r>   Ú$QueryFactoryParseResponseTests.setUpT  sV   € ô )ØØØØØØØô
ˆÔô &ŸOšO¨EÓ2ˆÔà(ˆÔô —o’o¤nÓ&6Ó7ˆŽr/   c                óÜ   € V P                   P                  pVP                  V P                   P                  V P                  4       V P                   P                  V P                  4       V# )zi
We can safely call L{QueryFactory.clientConnectionLost} as a callback
of L{QueryFactory.parseResponse}.
)rý   Údeferredr  ÚclientConnectionLostr  ÚparseResponser  r°  s   & r,   Ú test_parseResponseCallbackSafetyÚ?QueryFactoryParseResponseTests.test_parseResponseCallbackSafetyh  sT   € ð
 ×Ñ×&Ñ&ˆð 	
�‰�d×'Ñ'×<Ñ<¸d¿k¹kÔJØ×Ñ×'Ñ'¨×(9Ñ(9Ô:Øˆr/   c                óÜ   € V P                   P                  pVP                  V P                   P                  V P                  4       V P                   P                  V P                  4       V# )zi
We can safely call L{QueryFactory.clientConnectionLost} as an errback
of L{QueryFactory.parseResponse}.
)rý   r  Ú
addErrbackr  r  r  r  r°  s   & r,   Útest_parseResponseErrbackSafetyÚ>QueryFactoryParseResponseTests.test_parseResponseErrbackSafetyu  sT   € ð
 ×Ñ×&Ñ&ˆð 	
�‰�T×&Ñ&×;Ñ;¸T¿[¹[ÔIØ×Ñ×'Ñ'¨×(8Ñ(8Ô9Øˆr/   c                óÊ   € V P                   P                  pVP                  V P                   P                  V P                  4       V P                   P                  RR4       V# )ze
We can safely call L{QueryFactory.clientConnectionLost} as an errback
of L{QueryFactory.badStatus}.
ÚstatusÚmessage)rý   r  r  r  r  Ú	badStatusr°  s   & r,   Útest_badStatusErrbackSafetyÚ:QueryFactoryParseResponseTests.test_badStatusErrbackSafety‚  sP   € ð
 ×Ñ×&Ñ&ˆð 	
�‰�T×&Ñ&×;Ñ;¸T¿[¹[ÔIØ×Ñ×#Ñ# H¨iÔ8Øˆr/   c                ó”   € RpV P                   P                  pV P                   P                  V4       V P                  V\        4      # )z…
Some server can send a response without any data:
L{QueryFactory.parseResponse} should catch the error and call the
result errback.
zM
<methodResponse>
 <params>
  <param>
  </param>
 </params>
</methodResponse>)rý   r  r  rQ  Ú
IndexError)r*   r;   r  s   &  r,   Útest_parseResponseWithoutDataÚ<QueryFactoryParseResponseTests.test_parseResponseWithoutData�  sC   € ðˆð ×Ñ×&Ñ&ˆØ×Ñ×'Ñ'¨Ô0Ø×!Ñ! !¤ZÓ0Ð0r/   )r  r  rý   r  N)r0   r1   r2   r3   rR   r>   r  r  r  r#  r4   r5   rS   s   @r,   r	  r	  O  s(   ø‡ € ñò8ò(òò÷1ð 1r/   r	  c                   ó,   a € ] tR tRt o R tR tRtV tR# )ÚXMLRPCWithRequestTestsi¡  c                ó$   € \        4       V n        R # r(   )r[   r=   rO   s   &r,   r>   ÚXMLRPCWithRequestTests.setUp¢  s   € Ü›ˆŽr/   c                óö   a € \        R4      pRVn        \        \        P                  ! RR4      4      Vn        V 3R lpVP                  4       P                  W!4      pS P                  P                  V4       V# )z�
When an XML-RPC method is called and the implementation is
decorated with L{withRequest}, the request object is passed as
the first argument.
z/RPC2r#   r   c                 óz   <€ \         P                  ! VP                  ^ ,          4      pSP                  VR4       R# )rì   N))zPOST fooN)r   rE   rC   rB   )Únr8   Údatar*   s   && €r,   ÚvalidÚ6XMLRPCWithRequestTests.test_withRequest.<locals>.valid¯  s+   ø€ Ü—?’? 7§?¡?°1Õ#5Ó6ˆDØ×Ñ˜TÐ#8Ö9r/   )rŽ   )
r   r9   r   r   r:   r;   ÚnotifyFinishr  r=   Úrender_POST)r*   r8   r-  r  s   f   r,   Útest_withRequestÚ'XMLRPCWithRequestTests.test_withRequest¥  sd   ø€ ô ˜wÓ'ˆØˆŒÜ"¤9§?¢?°8¸]Ó#KÓLˆŒõ	:ð × Ñ Ó"×.Ñ.¨uÓ>ˆØ�‰×!Ñ! 'Ô*Øˆr/   )r=   N)r0   r1   r2   r3   r>   r1  r4   r5   rS   s   @r,   r&  r&  ¡  s   ø‡ € ò÷ð r/   r&  )FrR   rÎ  Úior   r   r   r   Útwisted.internetr   r   Útwisted.internet.errorr   Útwisted.internet.testingr   r	   Útwisted.loggerr
   r   r   r   Útwisted.pythonr   Útwisted.python.compatr   r   Útwisted.python.reflectr   Útwisted.trialÚtwisted.webr   r   r   r   r   Útwisted.web.test.test_webr   Útwisted.web.xmlrpcr   r   r   r   r   r   rŸ  ÚImportErrorÚTestCaser    r~  rU   r  rY   r[   r¯   r·   r¼   rÌ   rÈ   rÛ   râ   ré   r¡  r¦  r½  rÉ  rÌ  rÐ  rç  rý  r	  r&  r)   r/   r,   Ú<module>rA     sÉ  ðñ
ó
 ß  Ý ç +Ý 1ß H÷ó õ #ß =Ý .Ý "ß <Õ <Ý 2÷÷ ðÙÐ&Ô'ð €Gô-3�x×(Ñ(ô -3ô`	�|ô 	ô	�Zô 	ô\ˆ6ô \ô~
˜&ô 
ô*
˜ô 
ôB�Tô Bô$8˜×,Ñ,ô 8ô*
<�v×*Ñ*ô 
<ô#˜V×0Ñ0ô #ôA8�(×#Ñ#ô A8ôH ;ô ô4 x×'8Ñ'8ô 4÷n-ñ -ô`Ð3°X×5FÑ5Fô ô7Ð5°x×7HÑ7Hô 7ô=˜{ô =ô@>=˜{ô >=ôBN X×%6Ñ%6ô Nô:O1 X×%6Ñ%6ô O1ôd˜X×.Ñ.ö øðs ô ØƒGðús   Á6G Ç	G%Ç$G%