+
    üÐj  ã                   óº   € R t ^ RIt^ RIHt ^ RIHt ^ RIHt  ! R R4      t	R t
 ! R R	4      t ! R
 R4      t ! R R4      t ! R R4      tR t]! 4       tR tR# )a¼  
I{Private} test utilities for use throughout Twisted's test suite.  Unlike
C{proto_helpers}, this is no exception to the
don't-use-it-outside-Twisted-we-won't-maintain-compatibility rule!

@note: Maintainers be aware: things in this module should be gradually promoted
    to more full-featured test helpers and exposed as public API as your
    maintenance time permits.  In order to be public API though, they need
    their own test cases.
N)ÚBytesIO)Úminidom)ÚFileWrapperc                   ó6   a € ] tR t^t o RtR tR tR tRtV t	R# )ÚIOPumpz‚Utility to pump data between clients and servers for protocol testing.

Perhaps this is a utility worthy of being in protocol.py?
c                ó6   € Wn         W n        W0n        W@n        R # )N)ÚclientÚserverÚclientIOÚserverIO)Úselfr   r	   r
   r   s   &&&&&Ú8/usr/lib/python3/dist-packages/twisted/test/testutils.pyÚ__init__ÚIOPump.__init__   s   € ØŒØŒØ ŒØ Žó    c                ó6   € V P                  4       '       d   K  R# )z,Pump until there is no more input or output.N)Úpump)r   s   &r   ÚflushÚIOPump.flush"   s   € à�i‰i�kŠkÙñ r   c                ób  € V P                   P                  ^ 4       V P                  P                  ^ 4       V P                   P                  4       pV P                  P                  4       pV P                   P                  ^ 4       V P                  P                  ^ 4       V P                   P	                  4        V P                  P	                  4        V F  pV P
                  P                  V4       K   	  V F  pV P                  P                  V4       K   	  V'       g	   V'       d   ^# ^ # )z?Move data back and forth.

Returns whether any data was moved.
)r
   Úseekr   ÚreadÚtruncater	   ÚdataReceivedr   )r   ÚcDataÚsDataÚbytes   &   r   r   ÚIOPump.pump'   sÓ   € ð
 	�‰×Ñ˜1ÔØ�‰×Ñ˜1ÔØ—‘×"Ñ"Ó$ˆØ—‘×"Ñ"Ó$ˆØ�‰×Ñ˜1ÔØ�‰×Ñ˜1ÔØ�‰×ÑÔ Ø�‰×ÑÔ ÛˆDØ�K‰K×$Ñ$ TÖ*ñ ãˆDØ�K‰K×$Ñ$ TÖ*ñ ç—EÙár   )r   r
   r	   r   N)
Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   r   Ú__static_attributes__Ú__classdictcell__©Ú__classdict__s   @r   r   r      s   ø‡ € ñò
!ò÷
ð r   r   c                óî   € \        4       p\        4       pVP                  \        V4      4       V P                  \        V4      4       \        WW#4      pVP	                  4        VP	                  4        V# )z-Take two Protocol instances and connect them.)r   ÚmakeConnectionr   r   r   )r	   r   ÚcioÚsior   s   &&   r   ÚreturnConnectedr+   >   sY   € ä
‹)€CÜ
‹)€CØ
×Ñœ+ cÓ*Ô+Ø
×Ñœ+ cÓ*Ô+Ü�& #Ó+€Dà‡J�J„Là‡J�J„LØ€Kr   c                   ó*   a € ] tR t^Lt o RtR tRtV tR# )ÚXMLAssertionMixinz~
Test mixin defining a method for comparing serialized XML documents.

Must be mixed in to a L{test case<unittest.TestCase>}.
c                ó²   € V P                  \        P                  ! V4      P                  4       \        P                  ! V4      P                  4       4       R# )z¿
Verify that two strings represent the same XML document.

@param first: An XML string.
@type first: L{bytes}

@param second: An XML string that should match C{first}.
@type second: L{bytes}
N)ÚassertEqualÚdomÚparseStringÚtoxml)r   ÚfirstÚseconds   &&&r   ÚassertXMLEqualÚ XMLAssertionMixin.assertXMLEqualS   s;   € ð 	×ÑÜ�OŠO˜EÓ"×(Ñ(Ó*¬C¯OªO¸FÓ,C×,IÑ,IÓ,Kö	
r   © N)r   r   r    r!   r"   r5   r#   r$   r%   s   @r   r-   r-   L   s   ø‡ € ñ÷
ð 
r   r-   c                   ó6   a € ] tR t^bt o RtV 3R lR ltRtV tR# )Ú_EqualzF
A class the instances of which are equal to anything and everything.
c                ó&   <€ V ^8„  d   QhRS[ RS[/# ©é   ÚotherÚreturn©ÚobjectÚbool)Úformatr&   s   "€r   Ú__annotate__Ú_Equal.__annotate__g   s   ø€ ÷ ñ ™Fð ¡tñ r   c                ó   € R # )Tr7   ©r   r=   s   &&r   Ú__eq__Ú_Equal.__eq__g   s   € Ùr   r7   N©r   r   r    r!   r"   rG   r#   r$   r%   s   @r   r9   r9   b   s   ø‡ € ñ÷ö r   r9   c                   ó6   a € ] tR t^kt o RtV 3R lR ltRtV tR# )Ú	_NotEqualz6
A class the instances of which are equal to nothing.
c                ó&   <€ V ^8„  d   QhRS[ RS[/# r;   r?   )rB   r&   s   "€r   rC   Ú_NotEqual.__annotate__p   s   ø€ ÷ ñ ™Fð ¡tñ r   c                ó   € R # )Fr7   rF   s   &&r   rG   Ú_NotEqual.__eq__p   s   € Ùr   r7   NrI   r%   s   @r   rK   rK   k   s   ø‡ € ñ÷ö r   rK   c                   ó*   a € ] tR t^tt o RtR tRtV tR# )ÚComparisonTestsMixinaš  
A mixin which defines a method for making assertions about the correctness
of an implementation of C{==} and C{!=}.

Use this to unit test objects which follow the common convention for C{==}
and C{!=}:

    - The object compares equal to itself
    - The object cooperates with unrecognized types to allow them to
      implement the comparison
    - The object implements not-equal as the opposite of equal
c                óÊ  € V P                  W8H  4       V P                  W8H  4       V P                  W8H  4       V P                  W8g  4       V P                  W8g  4       V P                  W8g  4       V P                  V\        4       8H  4       V P                  V\        4       8g  4       V P                  V\        4       8H  4       V P                  V\        4       8g  4       R# )a  
Assert that C{firstValueOne} is equal to C{secondValueOne} but not
equal to C{valueOne} and that it defines equality cooperatively with
other types it doesn't know about.

@param firstValueOne: An object which is expected to compare as equal
    to C{secondValueOne} and not equal to C{valueTwo}.

@param secondValueOne: A different object than C{firstValueOne} but
    which is expected to compare equal to that object.

@param valueTwo: An object which is expected to compare as not equal to
    C{firstValueOne}.
N)Ú
assertTrueÚassertFalser9   rK   )r   ÚfirstValueOneÚsecondValueOneÚvalueTwos   &&&&r   Ú"assertNormalEqualityImplementationÚ7ComparisonTestsMixin.assertNormalEqualityImplementation‚   s´   € ð. 	�‰˜Ñ6Ô7Ø�‰˜Ñ7Ô8Ø×Ñ˜Ñ2Ô3Ø×Ñ˜Ñ7Ô8Ø×Ñ˜Ñ8Ô9Ø�‰˜Ñ1Ô2Ø�‰˜¬«Ñ1Ô2Ø×Ñ˜¬&«(Ñ2Ô3Ø×Ñ˜¬)«+Ñ5Ô6Ø�‰˜¬«Ñ4Ö5r   r7   N)r   r   r    r!   r"   rX   r#   r$   r%   s   @r   rQ   rQ   t   s   ø‡ € ñ÷ 6ð  6r   rQ   c                 óÐ   € Rp Rp \         P                   ! \         P                  4      p V P                  R4       RpV '       d   V P	                  4        V#   \         d     L'i ; i)z4Returns True if the system can bind an IPv6 address.NFT)z::1é    )ÚsocketÚAF_INET6ÚbindÚOSErrorÚclose)ÚsockÚhas_ipv6s     r   Ú	_has_ipv6rc   ¥   s[   € à€DØ€HðÜ�}Š}œVŸ_™_Ó-ˆØ�	‰	�*ÔØˆ÷ Ø�
‰
ŒØ€Oøô ô Ùðús   †7A ÁA%Á$A%c                 ó,   € \         '       g   R V n        V # )z.Does not work on systems without IPv6 support.)ÚHAS_IPV6Úskip)Úfs   &r   ÚskipWithoutIPv6rh   ¹   s   € ß‹8ØAˆŒØ€Hr   )r"   r\   Úior   Úxml.domr   r0   Útwisted.internet.protocolr   r   r+   r-   r9   rK   rQ   rc   re   rh   r7   r   r   Ú<module>rl      sd   ðñ	ó Ý Ý "å 1÷%ñ %òP÷
ñ 
÷,ñ ÷ñ ÷.6ñ .6òbñ" ‹;€ôr   