+
    üÐjI  ã                   ó¬   € R t ^ RIHtHtHt ^ RIHt ^ RIHt ^ RI	H
t
  ! R R]
P                  4      t ! R R4      t ! R	 R
]]
P                  4      tR# )z2
Test cases for twisted.protocols.postfix module.
)ÚDictÚListÚTuple)ÚStringTransport)Úpostfix)Úunittestc                   ó.   a € ] tR t^t o . ROtR tRtV tR# )ÚPostfixTCPMapQuoteTestsc                ó  € V P                    Fq  pV^ ,          pVR,          pV P                  \        P                  ! V4      V^ ,          4       V F)  pV P                  \        P                  ! V4      V4       K+  	  Ks  	  R# )é    :é   NNN)ÚdataÚassertEqualr   ÚquoteÚunquote)ÚselfÚentryÚrawÚquotedÚqs   &    Ú;/usr/lib/python3/dist-packages/twisted/test/test_postfix.pyÚtestDataÚ PostfixTCPMapQuoteTests.testData!   sb   € Ø—Y”YˆEØ˜•(ˆCØ˜2•YˆFà×ÑœWŸ]š]¨3Ó/°¸µÔ;Û�Ø× Ñ ¤§¢°Ó!3°SÖ9ó ó ó    © N))ó   foor   )s   foo bars	   foo%20bar)s   foo	bars	   foo%09bar)s   foo
bars	   foo%0Abars	   foo%0abar)s   foo
bars   foo%0D%0Abars   foo%0D%0abars   foo%0d%0Abars   foo%0d%0abar)s   foo s   foo%20)s    foos   %20foo)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r   r   Ú__static_attributes__Ú__classdictcell__©Ú__classdict__s   @r   r	   r	      s   ø‡ € ò€D÷":ð :r   r	   c                   óF   a € ] tR t^+t o / t. tR tR tR tV 3R lt	Rt
V tR# )ÚPostfixTCPMapServerTestCasec                óÂ  € \         P                  ! V P                  4      p\        4       p\         P                  ! 4       pWn        Wn        VP                  V4       V P                   Fa  w  rEVP                  V4       V P                  VP                  4       VRV: RV: RVP                  4       : 24       VP                  4        Kc  	  VP                  R4       R# )z±
Test that I{get} and I{put} commands are responded to correctly by
L{postfix.PostfixTCPMapServer} when its factory is an instance of
L{postifx.PostfixTCPMapDictServerFactory}.
zFor z, expected z	 but got N)r   ÚPostfixTCPMapDictServerFactoryr   r   ÚPostfixTCPMapServerÚserviceÚfactoryÚmakeConnectionÚchatÚlineReceivedr   ÚvalueÚclearÚ
setTimeout©r   r*   Ú	transportÚprotocolÚinputÚexpected_outputs   &     r   Ú	test_chatÚ%PostfixTCPMapServerTestCase.test_chat4   s±   € ô ×8Ò8¸¿¹ÓCˆÜ#Ó%ˆ	ä×.Ò.Ó0ˆØ"ÔØ"ÔØ×Ñ 	Ô*à&*§i¤iÑ"ˆEØ×!Ñ! %Ô(Ø×ÑØ—‘Ó!Ùã›/¨9¯?©?Õ+<ð>ôð �O‰OÖñ '0ð 	×Ñ˜DÖ!r   c                óÊ  € \         P                  ! V P                  4      p\        4       p\         P                  ! 4       pWn        Wn        VP                  V4       V P                   Fe  w  rEVP                  V4       V P                  VP                  4       VRP                  WEVP                  4       4      4       VP                  4        Kg  	  VP                  R4       R# )zº
Test that I{get} and I{put} commands are responded to correctly by
L{postfix.PostfixTCPMapServer} when its factory is an instance of
L{postifx.PostfixTCPMapDeferringDictServerFactory}.
z$For {!r}, expected {!r} but got {!r}N)r   Ú'PostfixTCPMapDeferringDictServerFactoryr   r   r(   r)   r*   r+   r,   r-   r   r.   Úformatr/   r0   r1   s   &     r   Útest_deferredChatÚ-PostfixTCPMapServerTestCase.test_deferredChatM   s¸   € ô ×AÒAÀ$Ç)Á)ÓLˆÜ#Ó%ˆ	ä×.Ò.Ó0ˆØ"ÔØ"ÔØ×Ñ 	Ô*à&*§i¤iÑ"ˆEØ×!Ñ! %Ô(Ø×ÑØ—‘Ó!ØØ6×=Ñ=Ø¨I¯O©OÓ,=óôð �O‰OÖñ '0ð 	×Ñ˜DÖ!r   c                óð   €  ! R R4      p\         P                  ! 4       pV! 4       Vn        \        4       Vn        VP                  R4       V P                  VP                  P                  4       R4       R# )zF
If the factory throws an exception,
error code 400 must be returned.
c                   ó*   a € ] tR t^mt o RtR tRtV tR# )ÚCPostfixTCPMapServerTestCase.test_getException.<locals>.ErrorFactoryz-
Factory that raises an error on key lookup.
c                ó   € \        R 4      h)zThis is a test error)Ú	Exception)r   Úkeys   &&r   ÚgetÚGPostfixTCPMapServerTestCase.test_getException.<locals>.ErrorFactory.getr   s   € ÜÐ 6Ó7Ð7r   r   N)r   r   r   r   Ú__doc__rC   r    r!   r"   s   @r   ÚErrorFactoryr?   m   s   ø‡ € ñ÷8ð 8r   rF   s   get examples   400 This is a test error
N)r   r(   r*   r   r2   r-   r   r.   )r   rF   Úservers   &  r   Útest_getExceptionÚ-PostfixTCPMapServerTestCase.test_getExceptiong   s^   € ÷	8ñ 	8ô ×,Ò,Ó.ˆÙ%›ˆŒÜ*Ó,ˆÔØ×Ñ˜NÔ+Ø×Ñ˜×)Ñ)×/Ñ/Ó1Ð3PÖQr   c                ón   <€ V ^8„  d   Qh/ S[ S[S[3,          ;R&   S[S[S[S[3,          ,          ;R&   # )é   r   r,   )r   Úbytesr   r   )r:   r#   s   "€r   Ú__annotate__Ú(PostfixTCPMapServerTestCase.__annotate__+   s8   ø‡ ‚ Ù
‰u‘eˆ|Õ
ñ ñ ñ
 ‰u‘U™E�\Õ"Õ
#ñ ò r   r   N)r   r   r   r   r   r,   r6   r;   rH   Ú__annotate_func__r    r!   r"   s   @r   r%   r%   +   s+   ø‡ € ð €Dð'€Dò"ò2"ò4R÷y ƒ r   r%   c                   ó*   € ] tR t^|tRRRR/t. ROtRtR# )Ú
ValidTestsr   s
   ThisIs Foos   bars    bar really is found
r   N)
)s   gets&   400 Command 'get' takes 1 parameters.
)s   get foo baró   500 
)s   putó&   400 Command 'put' takes 2 parameters.
)s   put foorS   )s   put foo bar bazó    500 put is not implemented yet.
)s   put foo barrT   )s   get foos   200 ThisIs%20Foo
)s   get bars'   200 %20bar%20really%20is%20found%0D%0A
)s   get bazrR   )r   s   400 unknown command
)r   r   r   r   r   r,   r    r   r   r   rQ   rQ   |   s   † à�ØÐ+ð€Dò„Dr   rQ   N)rE   Útypingr   r   r   Útwisted.internet.testingr   Útwisted.protocolsr   Útwisted.trialr   ÚTestCaser	   r%   rQ   r   r   r   Ú<module>rZ      sQ   ðñ÷ %Ñ $å 4Ý %Ý "ô:˜h×/Ñ/ô :÷8NRñ NRôbÐ,¨h×.?Ñ.?ö r   