+
    Df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    YYE(C2YFW]]3/;  !3S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""	*&*ii"E!!%(!/9??+<> OO '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""	*&*ii"E!!%(!6==IOO,= OO '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   getGPostfixTCPMapServerTestCase.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+))//13P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     
ue|
  
 uUE\"
#  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   