Ë
    ojüF  ã                   óÔ  — d Z ddlZddlZddlZddlZddlmZ ddlmZm	Z	m
Z
mZmZmZmZmZmZmZmZmZmZ ddlmZ ddlmZ ddlmZmZ  G d„ d	e«      Z G d
„ de«      Z G d„ de«      Z G d„ de«      Ze G d„ d«      «       Z  G d„ de«      Z! G d„ de«      Z" G d„ de«      Z# G d„ de«      Z$ G d„ de«      Z% G d„ de«      Z& G d„ de«      Z' G d „ d!e«      Z( G d"„ d#e«      Z)y)$z%
Tests for L{twisted.python.compat}.
é    N)ÚskipIf)Ú_PYPYÚ_get_async_paramÚbytesEnvironÚcmpÚ
comparableÚexecfileÚ
intToBytesÚioTypeÚ	iterbytesÚlazyByteSliceÚnativeStringÚnetworkStringÚreraise)ÚFilePath)Úplatform)ÚSynchronousTestCaseÚTestCasec                   ó:   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z	d„ Z
y	)
ÚIOTypeTestsz?
    Test cases for determining a file-like object's type.
    c                 óf   — | j                  t        t        j                  «       «      t        «       y)z=
        An L{io.StringIO} accepts and returns text.
        N)ÚassertEqualr   ÚioÚStringIOÚstr©Úselfs    ú:/usr/lib/python3/dist-packages/twisted/test/test_compat.pyÚtest_3StringIOzIOTypeTests.test_3StringIO)   s   € ð 	×Ñœ¤§¡£Ó.´Õ4ó    c                 óf   — | j                  t        t        j                  «       «      t        «       y)z=
        An L{io.BytesIO} accepts and returns bytes.
        N)r   r   r   ÚBytesIOÚbytesr   s    r   Útest_3BytesIOzIOTypeTests.test_3BytesIO/   s   € ð 	×Ñœ¤§
¡
£Ó-¬uÕ5r    c                 ó    — t        | j                  «       d«      5 }| j                  t        |«      t        «       ddd«       y# 1 sw Y   yxY w)zT
        A file opened via 'io.open' in text mode accepts and returns text.
        ÚwN)ÚopenÚmktempr   r   r   ©r   Úfs     r   Útest_3openTextModezIOTypeTests.test_3openTextMode5   s?   € ô �$—+‘+“- Ó%ð 	-¨Ø×ÑœV A›Y¬Ô,÷	-÷ 	-ñ 	-úó   › AÁAc                 ó    — t        | j                  «       d«      5 }| j                  t        |«      t        «       ddd«       y# 1 sw Y   yxY w)zW
        A file opened via 'io.open' in binary mode accepts and returns bytes.
        ÚwbN)r'   r(   r   r   r#   r)   s     r   Útest_3openBinaryModez IOTypeTests.test_3openBinaryMode<   s?   € ô �$—+‘+“- Ó&ð 	/¨!Ø×ÑœV A›Y¬Ô.÷	/÷ 	/ñ 	/úr,   c                 ó´   — t        j                  | j                  «       d«      5 }| j                  t	        |«      t
        «       ddd«       y# 1 sw Y   yxY w)z�
        The L{codecs} module, oddly, returns a file-like object which returns
        bytes when not passed an 'encoding' argument.
        r.   N)Úcodecsr'   r(   r   r   r#   r)   s     r   Útest_codecsOpenBytesz IOTypeTests.test_codecsOpenBytesC   sC   € ô
 �[‰[˜Ÿ™›¨Ó-ð 	/°Ø×ÑœV A›Y¬Ô.÷	/÷ 	/ñ 	/ús   ¥ AÁAc                 ó¸   — t        j                  | j                  «       dd¬«      5 }| j                  t	        |«      t
        «       ddd«       y# 1 sw Y   yxY w)zY
        When passed an encoding, however, the L{codecs} module returns unicode.
        r.   úutf-8)ÚencodingN)r1   r'   r(   r   r   r   r)   s     r   Útest_codecsOpenTextzIOTypeTests.test_codecsOpenTextK   sE   € ô �[‰[˜Ÿ™›¨°wÔ?ð 	-À1Ø×ÑœV A›Y¬Ô,÷	-÷ 	-ñ 	-ús   § AÁAc                 óR   — | j                  t        t        «       «      t        «       y)zy
        When passed an object about which no sensible decision can be made, err
        on the side of unicode.
        N)r   r   Úobjectr   r   s    r   Útest_defaultToTextzIOTypeTests.test_defaultToTextR   s   € ð
 	×Ñœ¤£Ó)¬3Õ/r    N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r$   r+   r/   r2   r6   r9   © r    r   r   r   $   s*   „ ñò5ò6ò-ò/ò/ò-ó0r    r   c                   ó   — e Zd ZdZd„ Zd„ Zy)ÚCompatTestszy
    Various utility functions in C{twisted.python.compat} provide same
    functionality as modern Python variants.
    c                 ó  — t        «       }|j                  d«       |j                  d«       |j                  d«       t        |«      }|j                  «        | j	                  |g d¢«       |j                  d«       t        |«      }|j                  «        | j	                  |ddg«       |j                  d«       ddh}|j                  |«      }t        |«      }|j                  «        | j	                  |g d¢«       y	)
zG
        L{set} should behave like the expected set interface.
        ÚbÚcÚa)rD   rB   rC   ÚdÚrÚs)rD   rC   rF   rG   N)ÚsetÚaddÚlistÚsortr   ÚremoveÚdiscardÚunion©r   rD   rB   rE   s       r   Útest_setzCompatTests.test_set`   sÃ   € ô ‹EˆØ	�‰ˆcŒ
Ø	�‰ˆcŒ
Ø	�‰ˆcŒ
Ü�‹GˆØ	�‰ŒØ×Ñ˜šOÔ,Ø	�‰�ŒÜ�‹GˆØ	�‰ŒØ×Ñ˜˜S #˜JÔ'à	�	‰	�#Œà�#ˆJˆØ�G‰G�A‹JˆÜ�‹GˆØ	�‰ŒØ×Ñ˜Ò0Õ1r    c                 ó*  — t        ddg«      }| j                  t        t        |d«       | j	                  t        |«      ddg«       t        ddg«      }|j                  |«      }t        |«      }|j                  «        | j	                  |g d¢«       y)zS
        L{frozenset} should behave like the expected frozenset interface.
        rD   rB   rI   rF   rG   )rD   rB   rF   rG   N)	Ú	frozensetÚassertRaisesÚAttributeErrorÚgetattrr   ÚsortedrN   rJ   rK   rO   s       r   Útest_frozensetzCompatTests.test_frozensetx   s|   € ô �s˜C�jÓ!ˆØ×Ñœ.¬'°1°eÔ<Ø×Ñœ › S¨# JÔ/ä�s˜C�jÓ!ˆØ�G‰G�A‹JˆÜ�‹GˆØ	�‰ŒØ×Ñ˜Ò0Õ1r    N)r:   r;   r<   r=   rP   rW   r>   r    r   r@   r@   Z   s   „ ñò
2ó02r    r@   c                   ó(   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zy)ÚExecfileCompatTestszE
    Tests for the Python 3-friendly L{execfile} implementation.
    c                 óØ   — | j                  «       }t        |d«      5 }|j                  |j                  d«      «       ddd«       t	        |j                  d«      «      S # 1 sw Y   Œ#xY w)zo
        Write L{content} to a new temporary file, returning the L{FilePath}
        for the new file.
        r.   ÚasciiNr4   )r(   r'   ÚwriteÚencoder   )r   ÚcontentÚpathr*   s       r   ÚwriteScriptzExecfileCompatTests.writeScriptŒ   sY   € ð
 �{‰{‹}ˆÜ�$˜Óð 	- Ø�G‰G�G—N‘N 7Ó+Ô,÷	-ä˜Ÿ™ GÓ,Ó-Ð-÷	-ð 	-ús   �!A Á A)c                 ó„   — | j                  d«      }ddi}t        |j                  |«       | j                  d|d   «       y)zX
        L{execfile} executes the specified file in the given global namespace.
        ú	foo += 1
Úfooé   é   N©r`   r	   r_   r   )r   ÚscriptÚglobalNamespaces      r   Útest_execfileGlobalsz(ExecfileCompatTests.test_execfileGlobals–   s@   € ð ×!Ñ! ,Ó/ˆØ  !˜*ˆÜ�—‘˜oÔ.Ø×Ñ˜˜O¨EÑ2Õ3r    c                 ó¸   — | j                  d«      }ddi}ddi}t        |j                  ||«       | j                  d|d   «       | j                  d|d   «       y)zk
        L{execfile} executes the specified file in the given global and local
        namespaces.
        rb   rc   é
   é   é   Nrf   )r   rg   rh   ÚlocalNamespaces       r   Útest_execfileGlobalsAndLocalsz1ExecfileCompatTests.test_execfileGlobalsAndLocalsŸ   s`   € ð
 ×!Ñ! ,Ó/ˆØ  "˜+ˆØ ˜ˆÜ�—‘˜o¨~Ô>Ø×Ñ˜˜_¨UÑ3Ô4Ø×Ñ˜˜^¨EÑ2Õ3r    c                 ó˜   — dD ]E  }| j                  d|z   «      }ddi}t        |j                  |«       | j                  d|d   «       ŒG y)z˜
        L{execfile} reads in the specified file using universal newlines so
        that scripts written on one platform will work on another.
        )ú
úz
zfoo = 'okay'rc   NÚokayrf   )r   Ú
lineEndingrg   rh   s       r   Útest_execfileUniversalNewlinesz2ExecfileCompatTests.test_execfileUniversalNewlines«   sT   € ð
 -ò 	=ˆJØ×%Ñ% n°zÑ&AÓBˆFØ$ d˜mˆOÜ�V—[‘[ /Ô2Ø×Ñ˜V _°UÑ%;Õ<ñ		=r    N)r:   r;   r<   r=   r`   ri   ro   ru   r>   r    r   rY   rY   ‡   s   „ ñò.ò4ò
4ó	=r    rY   c                   ó   — e Zd ZdZd„ Zy)ÚPYPYTestz!
    Identification of PyPy.
    c                 ó~   — dt         j                  v r| j                  t        «       y| j	                  t        «       y)z,
        On PyPy, L{_PYPY} is True.
        ÚPyPyN)ÚsysÚversionÚ
assertTruer   ÚassertFalser   s    r   Ú	test_PYPYzPYPYTest.test_PYPY¼   s*   € ð ”S—[‘[Ñ Ø�O‰OœEÕ"à×ÑœUÕ#r    N)r:   r;   r<   r=   r~   r>   r    r   rw   rw   ·   s   „ ñó$r    rw   c                   ó   — e Zd ZdZd„ Zd„ Zy)Ú
ComparablezE
    Objects that can be compared to each other, but not others.
    c                 ó   — || _         y ©N)Úvalue)r   rƒ   s     r   Ú__init__zComparable.__init__Ì   s	   € Øˆ�
r    c                 ón   — t        |t        «      st        S t        | j                  |j                  «      S r‚   )Ú
isinstancer€   ÚNotImplementedr   rƒ   )r   Úothers     r   Ú__cmp__zComparable.__cmp__Ï   s'   € Ü˜%¤Ô,Ü!Ð!Ü�4—:‘:˜uŸ{™{Ó+Ð+r    N)r:   r;   r<   r=   r„   r‰   r>   r    r   r€   r€   Æ   s   „ ñòó,r    r€   c                   ó4   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z	y)	ÚComparableTestszR
    L{comparable} decorated classes emulate Python 2's C{__cmp__} semantics.
    c                 óœ   — | j                  t        d«      t        d«      k(  «       | j                  t        d«      t        d«      k(  «       y)zo
        Instances of a class that is decorated by C{comparable} support
        equality comparisons.
        rd   re   N©r|   r€   r}   r   s    r   Útest_equalityzComparableTests.test_equalityÚ   s8   € ð 	�‰œ
 1›¬°A«Ñ6Ô7Ø×Ñœ A›¬*°Q«-Ñ7Õ8r    c                 óœ   — | j                  t        d«      t        d«      k7  «       | j                  t        d«      t        d«      k7  «       y)zq
        Instances of a class that is decorated by C{comparable} support
        inequality comparisons.
        rd   re   N)r}   r€   r|   r   s    r   Útest_nonEqualityz ComparableTests.test_nonEqualityã   s8   € ð 	×Ñœ A›¬*°Q«-Ñ7Ô8Ø�‰œ
 1›¬°A«Ñ6Õ7r    c                 óœ   — | j                  t        d«      t        d«      kD  «       | j                  t        d«      t        d«      kD  «       y)zs
        Instances of a class that is decorated by C{comparable} support
        greater-than comparisons.
        re   rd   r   é   Nr�   r   s    r   Útest_greaterThanz ComparableTests.test_greaterThanì   ó8   € ð
 	�‰œ
 1›¬
°1«Ñ5Ô6Ø×Ñœ A›¬°A«Ñ6Õ7r    c                 óè   — | j                  t        d«      t        d«      k\  «       | j                  t        d«      t        d«      k\  «       | j                  t        d«      t        d«      k\  «       y)z|
        Instances of a class that is decorated by C{comparable} support
        greater-than-or-equal comparisons.
        rd   re   r   r’   Nr�   r   s    r   Útest_greaterThanOrEqualz'ComparableTests.test_greaterThanOrEqualô   óQ   € ð
 	�‰œ
 1›¬°A«Ñ6Ô7Ø�‰œ
 1›¬°A«Ñ6Ô7Ø×Ñœ A›¬*°Q«-Ñ7Õ8r    c                 óœ   — | j                  t        d«      t        d«      k  «       | j                  t        d«      t        d«      k  «       y)zp
        Instances of a class that is decorated by C{comparable} support
        less-than comparisons.
        r   r’   re   Nr�   r   s    r   Útest_lessThanzComparableTests.test_lessThaný   r”   r    c                 óè   — | j                  t        d«      t        d«      k  «       | j                  t        d«      t        d«      k  «       | j                  t        d«      t        d«      k  «       y)zy
        Instances of a class that is decorated by C{comparable} support
        less-than-or-equal comparisons.
        r’   r   re   Nr�   r   s    r   Útest_lessThanOrEqualz$ComparableTests.test_lessThanOrEqual  r—   r    N)
r:   r;   r<   r=   rŽ   r�   r“   r–   r™   r›   r>   r    r   r‹   r‹   Õ   s%   „ ñò9ò8ò8ò9ò8ó9r    r‹   c                   ó4   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z	y)	ÚPython3ComparableTestsz;
    Python 3-specific functionality of C{comparable}.
    c                 óp   — | j                  t        d«      j                  t        «       «      t        «       y)zÁ
        Instances of a class that is decorated by C{comparable} support
        returning C{NotImplemented} from C{__eq__} if it is returned by the
        underlying C{__cmp__} call.
        rd   N)r   r€   Ú__eq__r8   r‡   r   s    r   Útest_notImplementedEqualsz0Python3ComparableTests.test_notImplementedEquals  ó%   € ð 	×Ñœ A›×-Ñ-¬f«hÓ7¼ÕHr    c                 óp   — | j                  t        d«      j                  t        «       «      t        «       y)zÁ
        Instances of a class that is decorated by C{comparable} support
        returning C{NotImplemented} from C{__ne__} if it is returned by the
        underlying C{__cmp__} call.
        rd   N)r   r€   Ú__ne__r8   r‡   r   s    r   Útest_notImplementedNotEqualsz3Python3ComparableTests.test_notImplementedNotEquals  r¡   r    c                 óp   — | j                  t        d«      j                  t        «       «      t        «       y)zÁ
        Instances of a class that is decorated by C{comparable} support
        returning C{NotImplemented} from C{__gt__} if it is returned by the
        underlying C{__cmp__} call.
        rd   N)r   r€   Ú__gt__r8   r‡   r   s    r   Útest_notImplementedGreaterThanz5Python3ComparableTests.test_notImplementedGreaterThan$  r¡   r    c                 óp   — | j                  t        d«      j                  t        «       «      t        «       y)zÁ
        Instances of a class that is decorated by C{comparable} support
        returning C{NotImplemented} from C{__lt__} if it is returned by the
        underlying C{__cmp__} call.
        rd   N)r   r€   Ú__lt__r8   r‡   r   s    r   Útest_notImplementedLessThanz2Python3ComparableTests.test_notImplementedLessThan,  r¡   r    c                 óp   — | j                  t        d«      j                  t        «       «      t        «       y)zÁ
        Instances of a class that is decorated by C{comparable} support
        returning C{NotImplemented} from C{__ge__} if it is returned by the
        underlying C{__cmp__} call.
        rd   N)r   r€   Ú__ge__r8   r‡   r   s    r   Ú$test_notImplementedGreaterThanEqualsz;Python3ComparableTests.test_notImplementedGreaterThanEquals4  r¡   r    c                 óp   — | j                  t        d«      j                  t        «       «      t        «       y)zÁ
        Instances of a class that is decorated by C{comparable} support
        returning C{NotImplemented} from C{__le__} if it is returned by the
        underlying C{__cmp__} call.
        rd   N)r   r€   Ú__le__r8   r‡   r   s    r   Ú!test_notImplementedLessThanEqualsz8Python3ComparableTests.test_notImplementedLessThanEquals<  r¡   r    N)
r:   r;   r<   r=   r    r¤   r§   rª   r­   r°   r>   r    r   r�   r�     s+   „ ñòIòIòIòIòIóIr    r�   c                   ó"   — e Zd ZdZd„ Zd„ Zd„ Zy)ÚCmpTestszA
    L{cmp} should behave like the built-in Python 2 C{cmp}.
    c                 ó°   — | j                  t        dd«      d«       | j                  t        dd«      d«       | j                  t        dgdg«      d«       y)z5
        L{cmp} returns 0 for equal objects.
        rD   r   rd   N©r   r   r   s    r   Útest_equalszCmpTests.test_equalsJ  sJ   € ð 	×Ñœ˜S #›¨Ô*Ø×Ñœ˜Q › AÔ&Ø×Ñœ˜a˜S 1 #›¨Õ*r    c                 ót   — | j                  t        dd«      d«       | j                  t        dd«      d«       y)zS
        L{cmp} returns 1 if its first argument is bigger than its second.
        é   r   rd   ó   zó   aNr´   r   s    r   r“   zCmpTests.test_greaterThanR  s0   € ð 	×Ñœ˜Q › AÔ&Ø×Ñœ˜T 4›¨!Õ,r    c                 ót   — | j                  t        dd«      d«       | j                  t        dd«      d«       y)zU
        L{cmp} returns -1 if its first argument is smaller than its second.
        gš™™™™™¹?gffffff@éÿÿÿÿr¹   ó   dNr´   r   s    r   r™   zCmpTests.test_lessThanY  s0   € ð 	×Ñœ˜S #›¨Ô+Ø×Ñœ˜T 4›¨"Õ-r    N)r:   r;   r<   r=   rµ   r“   r™   r>   r    r   r²   r²   E  s   „ ñò+ò-ó.r    r²   c                   ó:   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z	d„ Z
y	)
ÚStringTestsz8
    Compatibility functions and types for strings.
    c                 óx   — | j                  t        |«      |«       | j                  t        |«      t        «       y)z¶
        Raise an exception indicating a failed test if the output of
        C{nativeString(original)} is unequal to the expected string, or is not
        a native string.
        N)r   r   ÚassertIsInstancer   )r   ÚoriginalÚexpecteds      r   ÚassertNativeStringzStringTests.assertNativeStringf  s.   € ð 	×Ñœ hÓ/°Ô:Ø×Ñœl¨8Ó4´cÕ:r    c                 ó:   — | j                  t        t        d«       y)zj
        C{nativeString} raises a C{UnicodeError} if input bytes are not ASCII
        decodable.
        ó   ÿN©rS   ÚUnicodeErrorr   r   s    r   Útest_nonASCIIBytesToStringz&StringTests.test_nonASCIIBytesToStringo  s   € ð
 	×Ñœ,¬°gÕ>r    c                 ó:   — | j                  t        t        d«       y)zk
        C{nativeString} raises a C{UnicodeError} if input Unicode is not ASCII
        encodable.
        u   áˆ´NrÆ   r   s    r   Útest_nonASCIIUnicodeToStringz(StringTests.test_nonASCIIUnicodeToStringv  s   € ð
 	×Ñœ,¬°hÕ?r    c                 ó(   — | j                  dd«       y)z
        C{nativeString} converts bytes to the native string format, assuming
        an ASCII encoding if applicable.
        s   helloÚhelloN©rÃ   r   s    r   Útest_bytesToStringzStringTests.test_bytesToString}  s   € ð
 	×Ñ ¨'Õ2r    c                 ó(   — | j                  dd«       y)z�
        C{nativeString} converts unicode to the native string format, assuming
        an ASCII encoding if applicable.
        zGood dayNrÍ   r   s    r   Útest_unicodeToStringz StringTests.test_unicodeToString„  s   € ð
 	×Ñ 
¨JÕ7r    c                 ó(   — | j                  dd«       y)zJ
        C{nativeString} leaves native strings as native strings.
        zHello!NrÍ   r   s    r   Útest_stringToStringzStringTests.test_stringToString‹  s   € ð 	×Ñ ¨(Õ3r    c                 ó:   — | j                  t        t        d«       y)zu
        C{nativeString} raises a C{TypeError} if given an object that is not a
        string of some sort.
        rd   N)rS   Ú	TypeErrorr   r   s    r   Útest_unexpectedTypezStringTests.test_unexpectedType‘  s   € ð
 	×Ñœ)¤\°1Õ5r    N)r:   r;   r<   r=   rÃ   rÈ   rÊ   rÎ   rÐ   rÒ   rÕ   r>   r    r   r¾   r¾   a  s+   „ ñò;ò?ò@ò3ò8ò4ó6r    r¾   c                   ó"   — e Zd ZdZd„ Zd„ Zd„ Zy)ÚNetworkStringTestsz%
    Tests for L{networkString}.
    c                 ó:   — | j                  dt        d«      «       y)zu
        L{networkString} returns a C{unicode} object passed to it encoded into
        a C{bytes} instance.
        s   foorc   N)r   r   r   s    r   Útest_strzNetworkStringTests.test_strž  s   € ð
 	×Ñ˜¤¨uÓ!5Õ6r    c                 ó:   — | j                  t        t        d«       y)z�
        L{networkString} raises L{UnicodeError} if passed a C{unicode} instance
        containing characters not encodable in ASCII.
        u   â˜ƒN)rS   rÇ   r   r   s    r   Útest_unicodeOutOfRangez)NetworkStringTests.test_unicodeOutOfRange¥  s   € ð
 	×Ñœ,¬°}ÕEr    c                 ó€   — | j                  t        t        t        «       «       | j                  t        t        d«       y)z€
        L{networkString} raises L{TypeError} if passed a non-string object or
        the wrong type of string object.
        s   bytesN)rS   rÔ   r   r8   r   s    r   Útest_nonStringz!NetworkStringTests.test_nonString¬  s*   € ð
 	×Ñœ)¤]´F³HÔ=Ø×Ñœ)¤]°HÕ=r    N)r:   r;   r<   r=   rÙ   rÛ   rÝ   r>   r    r   r×   r×   ™  s   „ ñò7òFó>r    r×   c                   ó   — e Zd ZdZd„ Zd„ Zy)ÚReraiseTestszH
    L{reraise} re-raises exceptions on both Python 2 and Python 3.
    c                 ó´  — 	 ddz   	 t        d«       | j	                  d«       y# t         $ r t        j                  «       \  }}}Y ŒBw xY w# t         $ r� t        j                  «       \  }}}| j                  |t        «       | j                  |«       | j                  t        j                  «      d   t        j                  |«      d   «       Y yw xY w)z…
        Calling L{reraise} with an exception instance and a traceback of
        L{None} re-raises it with a new traceback.
        rd   r   NúThe exception was not raised.r»   )ÚBaseExceptionrz   Úexc_infor   Úfailr   ÚZeroDivisionErrorÚassertIsÚassertNotEqualÚ	tracebackÚ	format_tb©r   Útyprƒ   ÚtbÚtyp2Úvalue2Útb2s          r   Útest_reraiseWithNonez!ReraiseTests.test_reraiseWithNoneº  sÂ   € ð
	,Ø�ŠEð
	7Ü�E˜4Ô ð �I‰IÐ5Õ6øô ò 	,Ü Ÿ\™\›^‰NˆC�šð	,ûô ò 	Ü #§¡£ÑˆD�&˜#Ø×Ñ˜TÔ#4Ô5Ø�M‰M˜% Ô(Ø×ÑÜ×#Ñ# BÓ'¨Ñ+¬Y×-@Ñ-@ÀÓ-EÀbÑ-Iöð		úó!   ‚& ˆA ¦!A
Á	A
ÁBCÃCc                 ó´  — 	 ddz   	 t        «       | j	                  d«       y# t         $ r t        j                  «       \  }}}Y ŒBw xY w# t         $ r� t        j                  «       \  }}}| j                  |t        «       | j                  |«       | j                  t        j                  «      d   t        j                  |«      d   «       Y yw xY w)z‰
        Calling L{reraise} with an exception instance and a traceback
        re-raises the exception with the given traceback.
        rd   r   rá   r»   N)
râ   rz   rã   r   rä   r   rå   ræ   rè   ré   rê   s          r   Útest_reraiseWithTracebackz&ReraiseTests.test_reraiseWithTracebackÏ  sÂ   € ð
	,Ø�ŠEð	7Ü�E˜2Ôð �I‰IÐ5Õ6øô ò 	,Ü Ÿ\™\›^‰NˆC�šð	,ûô ò 	XÜ #§¡£ÑˆD�&˜#Ø×Ñ˜TÔ#4Ô5Ø�M‰M˜% Ô(Ø×ÑœY×0Ñ0°Ó4°RÑ8¼)×:MÑ:MÈcÓ:RÐSUÑ:VÖWð		Xúrñ   N)r:   r;   r<   r=   rð   ró   r>   r    r   rß   rß   µ  s   „ ñò7ó*7r    rß   c                   ó.   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd„ Zy)ÚPython3BytesTestszB
    Tests for L{iterbytes}, L{intToBytes}, L{lazyByteSlice}.
    c                 óX   — d}t        t        |«      «      }| j                  |g d¢«       y)z¯
        When L{iterbytes} is called with a bytestring, the returned object
        can be iterated over, resulting in the individual bytes of the
        bytestring.
        s   abcd)r¹   ó   bó   cr¼   N)rJ   r   r   )r   ÚinputÚresults      r   Útest_iterationz Python3BytesTests.test_iterationè  s)   € ð ˆÜ”i Ó&Ó'ˆØ×Ñ˜Ò!9Õ:r    c                 ó:   — | j                  t        d«      d«       y)z‹
        When L{intToBytes} is called with an integer, the result is an
        ASCII-encoded string representation of the number.
        éÕ   s   213N)r   r
   r   s    r   Útest_intToBytesz!Python3BytesTests.test_intToBytesò  s   € ð
 	×Ñœ C›¨&Õ1r    c                 óP   — d}| j                  t        t        |«      «      |«       y)zv
        L{lazyByteSlice} called with some bytes returns a semantically equal
        version of these bytes.
        ó   123XYZN©r   r#   r   ©r   Údatas     r   Útest_lazyByteSliceNoOffsetz,Python3BytesTests.test_lazyByteSliceNoOffsetù  s#   € ð
 ˆØ×Ñœœ}¨TÓ2Ó3°TÕ:r    c                 óX   — d}| j                  t        t        |d«      «      |dd «       y)z¡
        L{lazyByteSlice} called with some bytes and an offset returns a
        semantically equal version of these bytes starting at the given offset.
        r   re   Nr  r  s     r   Útest_lazyByteSliceOffsetz*Python3BytesTests.test_lazyByteSliceOffset  s+   € ð
 ˆØ×Ñœœ}¨T°1Ó5Ó6¸¸Q¸R¸ÕAr    c           	      óZ   — d}| j                  t        t        |dd«      «      |dd «       y)zË
        L{lazyByteSlice} called with some bytes, an offset and a length returns
        a semantically equal version of these bytes starting at the given
        offset, up to the given length.
        r   re   r’   é   Nr  r  s     r   Ú!test_lazyByteSliceOffsetAndLengthz3Python3BytesTests.test_lazyByteSliceOffsetAndLength	  s-   € ð ˆØ×Ñœœ}¨T°1°aÓ8Ó9¸4ÀÀ!¸9ÕEr    N)	r:   r;   r<   r=   rû   rþ   r  r  r	  r>   r    r   rõ   rõ   ã  s"   „ ñò;ò2ò;òBóFr    rõ   c                   óL   — e Zd ZdZ e ej                  «       d«      d„ «       Zy)ÚBytesEnvironTestsz$
    Tests for L{BytesEnviron}.
    z+Environment vars are always str on Windows.c                 ó  — t        «       }t        «       }|j                  «       D ]9  \  }}|j                  t	        |«      «       |j                  t	        |«      «       Œ; | j                  t        |«      t        g«       y)zz
        The output of L{BytesEnviron} should always be a L{dict} with L{bytes}
        values and L{bytes} keys.
        N)r   rH   ÚitemsrI   Útyper   rJ   r#   )r   rú   ÚtypesÚkeyÚvals        r   Útest_alwaysBytesz"BytesEnvironTests.test_alwaysBytes  sc   € ô “ˆÜ“ˆàŸ™›ò 	!‰HˆC�Ø�I‰I”d˜3“iÔ Ø�I‰I”d˜3“iÕ ð	!ð 	×Ñœ˜e›¤u gÕ.r    N)r:   r;   r<   r=   r   r   Ú	isWindowsr  r>   r    r   r  r    s0   „ ññ ÐˆH×ÑÓ Ð"OÓPñ/ó Qñ/r    r  c                   ó   — e Zd ZdZd„ Zd„ Zy)ÚGetAsyncParamTestsz=
    Tests for L{twisted.python.compat._get_async_param}
    c                 ó,  — | j                  t        d¬«      d«       | j                  t        d¬«      d«       | j                  t        dddiddi¤Žd«       | j                  t        dddiddi¤Žd«       | j                  t        t        dddi«       y)z•
        L{twisted.python.compat._get_async_param} uses isAsync by default,
        or deprecated async keyword argument if isAsync is None.
        F)ÚisAsyncTr  NÚasyncr>   )r   r   rS   rÔ   r   s    r   Útest_get_async_paramz'GetAsyncParamTests.test_get_async_param-  s�   € ð
 	×ÑÔ)°%Ô8¸%Ô@Ø×ÑÔ)°$Ô7¸Ô>Ø×ÑÔ)ÑK°$ÐK¸7ÀEÐ:JÑKÈUÔSØ×ÑÔ)ÑJ°$ÐJ¸7ÀD¸/ÑJÈDÔQØ×Ñœ)Ô%5°u¸wÈÐ>NÕOr    c                 ó¬   — | j                  t        d	ddiddi¤Žd«       | j                  | j                  g¬«      }| j                  |d   d   d«       y)
z…
        L{twisted.python.compat._get_async_param} raises a deprecation
        warning if async keyword argument is passed.
        r  Nr  F)ÚoffendingFunctionsr   Úmessagez:'async' keyword argument is deprecated, please use isAsyncr>   )r   r   ÚflushWarningsÚ test_get_async_param_deprecation)r   ÚcurrentWarningss     r   r  z3GetAsyncParamTests.test_get_async_param_deprecation8  sh   € ð
 	×ÑÔ)ÑK°$ÐK¸7ÀEÐ:JÑKÈUÔSØ×,Ñ,Ø $× EÑ EÐFð -ó 
ˆð 	×ÑØ˜AÑ˜yÑ)ØHõ	
r    N)r:   r;   r<   r=   r  r  r>   r    r   r  r  (  s   „ ñò	Pó
r    r  )*r=   r1   r   rz   rè   Úunittestr   Útwisted.python.compatr   r   r   r   r   r	   r
   r   r   r   r   r   r   Útwisted.python.filepathr   Útwisted.python.runtimer   Útwisted.trial.unittestr   r   r   r@   rY   rw   r€   r‹   r�   r²   r¾   r×   rß   rõ   r  r  r>   r    r   ú<module>r%     s  ðñ
ó
 Û 	Û 
Û Ý ÷÷ ÷ õ õ -Ý +ß @ô30Ð%ô 30ôl*2Ð%ô *2ôZ-=Ð-ô -=ô`$Ð"ô $ð ÷,ð ,ó ð,ô79Ð)ô 79ôt3IÐ0ô 3Iôl.Ð"ô .ô856Ð%ô 56ôp>Ð,ô >ô8+7Ð&ô +7ô\-FÐ+ô -Fô`/˜ô /ô*
Ð,õ 
r    