+
    üÐjÿ  ã                   ó–   € R t ^ RIHtHt ^ RIHtHtHtHt	H
t
Ht ^ RIHt ^ RIHt ^RIHt ^RIHt  ! R R]4      t ! R	 R
]4      tR# )z1
Tests for L{twisted.protocols.haproxy._parser}.
)ÚTypeÚUnion)ÚTCP4ServerEndpointÚTCP6ServerEndpointÚUNIXServerEndpointÚ_parseÚ_WrapperServerEndpointÚserverFromString)ÚMemoryReactor)ÚSynchronousTestCase)ÚunparseEndpoint)ÚHAProxyWrappingFactoryc                   ó¢   a € ] tR t^t o RtV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR	 ltV 3R
 lR lt	V 3R lR lt
V 3R lR ltRtV tR# )ÚUnparseEndpointTestsz[
Tests to ensure that un-parsing an endpoint string round trips through
escaping properly.
c                ó$   <€ V ^8„  d   QhRS[ RR/# )é   ÚinputÚreturnN)Ústr)ÚformatÚ__classdict__s   "€ÚL/usr/lib/python3/dist-packages/twisted/protocols/haproxy/test/test_parser.pyÚ__annotate__Ú!UnparseEndpointTests.__annotate__   s   ø€ ÷ 
Hñ 
H™3ð 
H 4ñ 
Hó    c                óJ   € V P                  \        \        V4      !  V4       R# )a	  
Check that the input unparses into the output, raising an assertion
error if it doesn't.

@param input: an input in endpoint-string-description format.  (To
    ensure determinism, keyword arguments should be in alphabetical
    order.)
@type input: native L{str}
N)ÚassertEqualr   ÚparseEndpoint)Úselfr   s   &&r   ÚcheckÚUnparseEndpointTests.check   s   € ð 	×Ñœ¬-¸Ó*>Ñ?ÀÖGr   c                ó   <€ V ^8„  d   QhRR/# ©r   r   N© )r   r   s   "€r   r   r   )   s   ø€ ÷ ñ  4ñ r   c                ó(   € V P                  R4       R# )z
An individual word.
ÚwordN©r   ©r   s   &r   Útest_basicUnparseÚ&UnparseEndpointTests.test_basicUnparse)   s   € ð 	�
‰
�6Ör   c                ó   <€ V ^8„  d   QhRR/# r"   r#   )r   r   s   "€r   r   r   /   s   ø€ ÷ ñ ¨ñ r   c                ó(   € V P                  R4       R# )z
Multiple arguments.
zone:twoNr&   r'   s   &r   Útest_multipleArgumentsÚ+UnparseEndpointTests.test_multipleArguments/   s   € ð 	�
‰
�9Ör   c                ó   <€ V ^8„  d   QhRR/# r"   r#   )r   r   s   "€r   r   r   5   s   ø€ ÷ (ñ (˜tñ (r   c                ó(   € V P                  R4       R# )z
Keyword arguments.
zaleph=one:bet=twoNr&   r'   s   &r   Útest_keywordsÚ"UnparseEndpointTests.test_keywords5   s   € ð 	�
‰
Ð&Ö'r   c                ó   <€ V ^8„  d   QhRR/# r"   r#   )r   r   s   "€r   r   r   ;   s   ø€ ÷ ,ñ , dñ ,r   c                ó(   € V P                  R4       R# )z
Escaped ":".
zhello\:colon\:worldNr&   r'   s   &r   Útest_colonInArgumentÚ)UnparseEndpointTests.test_colonInArgument;   s   € ð 	�
‰
Ð*Ö+r   c                ó   <€ V ^8„  d   QhRR/# r"   r#   )r   r   s   "€r   r   r   A   s   ø€ ÷  ñ  ¨$ñ  r   c                ó(   € V P                  R4       R# )z
Escaped ":" in keyword value.
zhello=\:Nr&   r'   s   &r   Útest_colonInKeywordValueÚ-UnparseEndpointTests.test_colonInKeywordValueA   ó   € ð 	�
‰
�;Ör   c                ó   <€ V ^8„  d   QhRR/# r"   r#   )r   r   s   "€r   r   r   G   s   ø€ ÷  ñ  ¨ñ  r   c                ó(   € V P                  R4       R# )z
Escaped ":" in keyword name.
z\:=helloNr&   r'   s   &r   Útest_colonInKeywordNameÚ,UnparseEndpointTests.test_colonInKeywordNameG   r:   r   r#   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r(   r,   r0   r4   r8   r=   Ú__static_attributes__Ú__classdictcell__©r   s   @r   r   r      sR   ø‡ € ñ÷

Hð 
H÷ð ÷ð ÷(ð (÷,ð ,÷ ð  ÷ ö  r   r   c                   ól   a € ] tR t^Nt o RtV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR	 ltR
t	V t
R# )ÚHAProxyServerParserTestsz8
Tests that the parser generates the correct endpoints.
c                óv   <€ V ^8„  d   QhRS[ RS[S[S[,          S[S[,          S[S[,          3,          RS[/# )r   ÚdescriptionÚexpectedClassr   )r   r   r   r   r   r   r   )r   r   s   "€r   r   Ú%HAProxyServerParserTests.__annotate__S   sN   ø€ ÷  ñ  áð ñ ÙÑ#Õ$ÙÑ#Õ$ÙÑ#Õ$ð&õ
ð ñ 
 ñ r   c                ó  € \        4       p\        W14      pV P                  V\        4       \	        V\        4      '       g   Q hV P                  VP
                  V4       V P                  VP                  \        4       V# )aÅ  
Test the C{haproxy} enpdoint prefix against one sub-endpoint type.

@param description: A string endpoint description beginning with
    C{haproxy}.
@type description: native L{str}

@param expectedClass: the expected sub-endpoint class given the
    description.
@type expectedClass: L{type}

@return: the parsed endpoint
@rtype: L{IStreamServerEndpoint}

@raise twisted.trial.unittest.Failtest: if the parsed endpoint doesn't
    match expectations.
)	r
   r	   ÚassertIsInstancer   Ú
isinstanceÚ_wrappedEndpointÚassertIsÚ_wrapperFactoryr   )r   rJ   rK   ÚreactorÚendpoints   &&&  r   Ú	onePrefixÚ"HAProxyServerParserTests.onePrefixS   sj   € ô4  “/ˆÜ# GÓ9ˆØ×Ñ˜hÔ(>Ô?Ü˜(Ô$:×;Ò;Ð;Ð;Ø×Ñ˜h×7Ñ7¸ÔGØ�‰�h×.Ñ.Ô0FÔGØˆr   c                ó   <€ V ^8„  d   QhRR/# r"   r#   )r   r   s   "€r   r   rL   u   s   ø€ ÷ ?ñ ?˜4ñ ?r   c                ó2   € V P                  R\        4       R# )z7
Test if the parser generates a wrapped TCP4 endpoint.
zhaproxy:tcp:8080N)rU   r   r'   s   &r   Ú	test_tcp4Ú"HAProxyServerParserTests.test_tcp4u   s   € ð 	�‰Ð)Ô+=Ö>r   c                ó   <€ V ^8„  d   QhRR/# r"   r#   )r   r   s   "€r   r   rL   {   s   ø€ ÷ @ñ @˜4ñ @r   c                ó2   € V P                  R\        4       R# )z7
Test if the parser generates a wrapped TCP6 endpoint.
zhaproxy:tcp6:8080N)rU   r   r'   s   &r   Ú	test_tcp6Ú"HAProxyServerParserTests.test_tcp6{   s   € ð 	�‰Ð*Ô,>Ö?r   c                ó   <€ V ^8„  d   QhRR/# r"   r#   )r   r   s   "€r   r   rL   �   s   ø€ ÷ Oñ O˜4ñ Or   c                ó2   € V P                  R\        4       R# )z7
Test if the parser generates a wrapped UNIX endpoint.
z haproxy:unix:address=/tmp/socketN)rU   r   r'   s   &r   Ú	test_unixÚ"HAProxyServerParserTests.test_unix�   s   € ð 	�‰Ð9Ô;MÖNr   r#   N)r?   r@   rA   rB   rC   rU   rY   r]   ra   rD   rE   rF   s   @r   rH   rH   N   s7   ø‡ € ñ÷ ð  ÷D?ð ?÷@ð @÷Oö Or   rH   N)rC   Útypingr   r   Útwisted.internet.endpointsr   r   r   r   r   r   r	   Útwisted.internet.testingr
   Útwisted.trial.unittestr   ÚTestCaseÚ_parserr   Ú_wrapperr   r   rH   r#   r   r   Ú<module>rj      sB   ðñ÷ ÷÷ õ 3Ý BÝ %Ý -ô4 ˜8ô 4 ôn7O˜xö 7Or   