ó
    Ö›‘hJ   ã                   ó®  • S SK r S SKrS SKJr  S SKJrJrJrJr  S SK	J
r
  S SKJr  S SKJrJr  \R                   " 5       (       + r \R$                    Sr " S	 S
5      r " S S\5      r " S S\\5      r " S S\\5      r " S S\\5      r " S S\\5      r\" \S5       " S S\5      5       r\" \S5       " S S\\5      5       rg! \ a    Sr Nf = f)é    N)ÚskipIf)ÚHostnameAddressÚIPv4AddressÚIPv6AddressÚUNIXAddress)ÚnativeString)Úplatform)ÚSynchronousTestCaseÚTestCaseFTc                   ó,   • \ rS rSrS rS rS rS rSrg)ÚAddressTestCaseMixiné   c                 óÄ   • U R                  U R                  5       U R                  5       :H  5        U R                  U R                  5       U R                  5       :g  5        g)zë
Two different address instances, sharing the same properties are
considered equal by C{==} and not considered not equal by C{!=}.

Note: When applied via UNIXAddress class, this uses the same
filename for both objects being compared.
N)Ú
assertTrueÚbuildAddressÚassertFalse©Úselfs    ÚfC:\Users\psant\Downloads\Noiseback\school\venv\Lib\site-packages\twisted/internet/test/test_address.pyÚtest_addressComparisonÚ+AddressTestCaseMixin.test_addressComparison   sL   € ð 	�‰˜×)Ñ)Ó+¨t×/@Ñ/@Ó/BÑBÔCØ×Ñ˜×*Ñ*Ó,°×0AÑ0AÓ0CÑCÕDó    c                 ón   • U R                  5       nUS0nU R                  X R                  5          5        g)z{
C{__hash__} can be used to get a hash of an address, allowing
addresses to be used as keys in dictionaries, for instance.
TN©r   r   ©r   ÚaddrÚds      r   Ú	test_hashÚAddressTestCaseMixin.test_hash)   ó3   € ð
 × Ñ Ó"ˆØ�4ˆLˆØ�‰˜×+Ñ+Ó-Ñ.Õ/r   c                 ó„  • U R                  U R                  5       U R                  5       :H  5        U R                  U R                  5       U R                  5       :H  5        U R                  U R                  5       U R                  5       :g  5        U R                  U R                  5       U R                  5       :g  5        g)zf
Check that comparison operators work correctly on address objects
when a different name is passed in
N)r   r   ÚbuildDifferentAddressr   r   s    r   Útest_differentNamesComparisonÚ2AddressTestCaseMixin.test_differentNamesComparison2   s”   € ð
 	×Ñ˜×*Ñ*Ó,°×0JÑ0JÓ0LÑLÔMØ×Ñ˜×3Ñ3Ó5¸×9JÑ9JÓ9LÑLÔMà�‰˜×)Ñ)Ó+¨t×/IÑ/IÓ/KÑKÔLØ�‰˜×2Ñ2Ó4¸×8IÑ8IÓ8KÑKÕLr   c                 óÆ   • U R                  U/5      nU R                  US   S   [        5        U R                  US   S   U5        U R                  [        U5      S5        g)zc
Assert that the a DeprecationWarning with the given message was
emitted against the given method.
r   ÚcategoryÚmessageé   N)ÚflushWarningsÚassertEqualÚDeprecationWarningÚlen)r   Ú
testMethodr'   Úwarningss       r   ÚassertDeprecationsÚ'AddressTestCaseMixin.assertDeprecations=   s]   € ð
 ×%Ñ% z lÓ3ˆØ×Ñ˜ !™ ZÑ0Ô2DÔEØ×Ñ˜ !™ YÑ/°Ô9Ø×Ñœ˜X›¨Õ*r   © N)	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r   r   r#   r/   Ú__static_attributes__r1   r   r   r   r      s   † ò	Eò0ò	Mõ+r   r   c                   ó   • \ rS rSrSrSrg)ÚIPv4AddressTestCaseMixinéH   ©)Útypeú%s)Úhostú%r©Úportz%dr1   N)r2   r3   r4   r5   ÚaddressArgSpecr6   r1   r   r   r8   r8   H   s   † ØEƒNr   r8   c                   ó(   • \ rS rSrSrSrS rS rSrg)ÚHostnameAddressTestséL   z#
Test case for L{HostnameAddress}.
))Úhostnamer<   r?   c                 ó   • [        SS5      $ )z_
Create an arbitrary new L{HostnameAddress} instance.

@return: A L{HostnameAddress} instance.
s   example.comr   ©r   r   s    r   r   Ú!HostnameAddressTests.buildAddressS   ó   € ô ˜~¨qÓ1Ð1r   c                 ó   • [        SS5      $ )z_
Like L{buildAddress}, but with a different hostname.

@return: A L{HostnameAddress} instance.
s   example.netr   rG   r   s    r   r"   Ú*HostnameAddressTests.buildDifferentAddress[   rI   r   r1   N)	r2   r3   r4   r5   Ú__doc__rA   r   r"   r6   r1   r   r   rC   rC   L   s   † ñð :€Nò2õ2r   rC   c                   ó    • \ rS rSrS rS rSrg)ÚIPv4AddressTCPTestséd   c                 ó   • [        SSS5      $ )z’
Create an arbitrary new L{IPv4Address} instance with a C{"TCP"}
type.  A new instance is created for each call, but always for the
same address.
ÚTCPú	127.0.0.1r   ©r   r   s    r   r   Ú IPv4AddressTCPTests.buildAddresse   ó   € ô ˜5 +¨qÓ1Ð1r   c                 ó   • [        SSS5      $ )ú;
Like L{buildAddress}, but with a different fixed address.
rQ   ú	127.0.0.2r   rS   r   s    r   r"   Ú)IPv4AddressTCPTests.buildDifferentAddressm   ó   € ô ˜5 +¨qÓ1Ð1r   r1   N©r2   r3   r4   r5   r   r"   r6   r1   r   r   rN   rN   d   ó   † ò2õ2r   rN   c                   ó    • \ rS rSrS rS rSrg)ÚIPv4AddressUDPTestsét   c                 ó   • [        SSS5      $ )z’
Create an arbitrary new L{IPv4Address} instance with a C{"UDP"}
type.  A new instance is created for each call, but always for the
same address.
ÚUDPrR   r   rS   r   s    r   r   Ú IPv4AddressUDPTests.buildAddressu   rU   r   c                 ó   • [        SSS5      $ )rW   ra   rX   r   rS   r   s    r   r"   Ú)IPv4AddressUDPTests.buildDifferentAddress}   rZ   r   r1   Nr[   r1   r   r   r^   r^   t   r\   r   r^   c                   ó$   • \ rS rSrSrS rS rSrg)ÚIPv6AddressTestsé„   r:   c                 ó   • [        SSS5      $ )z’
Create an arbitrary new L{IPv6Address} instance with a C{"TCP"}
type.  A new instance is created for each call, but always for the
same address.
rQ   z::1r   ©r   r   s    r   r   ÚIPv6AddressTests.buildAddress‡   s   € ô ˜5 %¨Ó+Ð+r   c                 ó   • [        SSS5      $ )rW   rQ   z::2r   ri   r   s    r   r"   Ú&IPv6AddressTests.buildDifferentAddress�   s   € ô ˜5 %¨Ó+Ð+r   r1   N)r2   r3   r4   r5   rA   r   r"   r6   r1   r   r   rf   rf   „   s   † ØE€Nò,õ,r   rf   z&Platform doesn't support UNIX sockets.c                   ól   • \ rS rSrSrS rS rS rS r\	" \
S5      S 5       r\	" \
S5      S	 5       rS
rg)ÚUNIXAddressTestsé–   ©)Únamer>   c                 óX   • U R                  5       U l        U R                  5       U l        g ©N)ÚmktempÚ_socketAddressÚ_otherAddressr   s    r   ÚsetUpÚUNIXAddressTests.setUpš   s   € Ø"Ÿk™k›mˆÔØ!Ÿ[™[›]ˆÕr   c                 ó,   • [        U R                  5      $ )z}
Create an arbitrary new L{UNIXAddress} instance.  A new instance is
created for each call, but always for the same address.
©r   ru   r   s    r   r   ÚUNIXAddressTests.buildAddressž   s   € ô
 ˜4×.Ñ.Ó/Ð/r   c                 ó,   • [        U R                  5      $ )rW   )r   rv   r   s    r   r"   Ú&UNIXAddressTests.buildDifferentAddress¥   s   € ô ˜4×-Ñ-Ó.Ð.r   c                 ó‚   • U R                  [        U R                  5       5      S[        U R                  5      -  5        g)zV
The repr of L{UNIXAddress} returns with the filename that the
L{UNIXAddress} is for.
zUNIXAddress('%s')N)r*   Úreprr   r   ru   r   s    r   Ú	test_reprÚUNIXAddressTests.test_repr«   s6   € ð
 	×ÑÜ�×"Ñ"Ó$Ó%Ø¤<°×0CÑ0CÓ#DÑEõ	
r   ú"Platform does not support symlinksc                 óÂ  • U R                  5       n[        U R                  S5       U l        [        R
                  " [        R                  R                  U R                  5      U5        U R                  [        U R                  5      [        U5      5        U R                  [        U5      [        U R                  5      5        SSS5        g! , (       d  f       g= f)zE
UNIXAddress objects compare as equal if they link to the same file.
ÚwN)
rt   Úopenru   ÚfdÚosÚsymlinkÚpathÚabspathr*   r   ©r   ÚlinkNames     r   Útest_comparisonOfLinkedFilesÚ-UNIXAddressTests.test_comparisonOfLinkedFilesµ   s�   € ð
 —;‘;“=ˆÜ�$×%Ñ% sÔ+¨t¬wÜ�JŠJ”r—w‘w—‘ t×':Ñ':Ó;¸XÔFØ×Ñœ[¨×)<Ñ)<Ó=¼{È8Ó?TÔUØ×Ñœ[¨Ó2´KÀ×@SÑ@SÓ4TÔU÷ ,×+Ö+úó   §B CÃ
Cc           	      óŠ  • U R                  5       n[        U R                  S5       U l        [        R
                  " [        R                  R                  U R                  5      U5        U R                  [        [        U R                  5      5      [        [        U5      5      5        SSS5        g! , (       d  f       g= f)zE
UNIXAddress Objects that compare as equal have the same hash value.
r„   N)rt   r…   ru   r†   r‡   rˆ   r‰   rŠ   r*   Úhashr   r‹   s     r   Útest_hashOfLinkedFilesÚ'UNIXAddressTests.test_hashOfLinkedFilesÀ   s}   € ð
 —;‘;“=ˆÜ�$×%Ñ% sÔ+¨t¬wÜ�JŠJ”r—w‘w—‘ t×':Ñ':Ó;¸XÔFØ×ÑÜ”[ ×!4Ñ!4Ó5Ó6¼¼[ÈÓ=RÓ8Sô÷ ,×+Ö+ús   §BB4Â4
C)rv   ru   r†   N)r2   r3   r4   r5   rA   rw   r   r"   r€   r   ÚsymlinkSkipr�   r’   r6   r1   r   r   rn   rn   –   sU   † à&€Nò+ò0ò/ò
ñ ˆKÐ=Ó>ñVó ?ðVñ ˆKÐ=Ó>ñ	ó ?ó	r   rn   z&platform doesn't support UNIX sockets.c                   óR   • \ rS rSrSrSrS rS rS r\	" \
S5      S 5       rS	 rS
rg)ÚEmptyUNIXAddressTestséÍ   zB
Tests for L{UNIXAddress} operations involving a L{None} address.
rp   c                 ó.   • U R                  5       U l        g rs   )rt   ru   r   s    r   rw   ÚEmptyUNIXAddressTests.setUpÕ   s   € Ø"Ÿk™k›mˆÕr   c                 ó   • [        S5      $ )z­
Create an arbitrary new L{UNIXAddress} instance.  A new instance is
created for each call, but always for the same address. This builds it
with a fixed address of L{None}.
N)r   r   s    r   r   Ú"EmptyUNIXAddressTests.buildAddressØ   s   € ô ˜4Ó Ð r   c                 ó,   • [        U R                  5      $ )z>
Like L{buildAddress}, but with a random temporary directory.
rz   r   s    r   r"   Ú+EmptyUNIXAddressTests.buildDifferentAddressà   s   € ô ˜4×.Ñ.Ó/Ð/r   r‚   c                 óÂ  • U R                  5       n[        U R                  S5       U l        [        R
                  " [        R                  R                  U R                  5      U5        U R                  [        U R                  5      [        S5      5        U R                  [        S5      [        U R                  5      5        SSS5        g! , (       d  f       g= f)zn
A UNIXAddress referring to a L{None} address does not
compare equal to a UNIXAddress referring to a symlink.
r„   N)
rt   r…   ru   r†   r‡   rˆ   r‰   rŠ   ÚassertNotEqualr   r‹   s     r   r�   Ú2EmptyUNIXAddressTests.test_comparisonOfLinkedFilesæ   s�   € ð —;‘;“=ˆÜ�$×%Ñ% sÔ+¨t¬wÜ�JŠJ”r—w‘w—‘ t×':Ñ':Ó;¸XÔFØ×Ñ¤¨D×,?Ñ,?Ó @Ä+ÈdÓBSÔTØ×Ñ¤¨DÓ 1´;¸t×?RÑ?RÓ3SÔT÷ ,×+Ö+úr�   c                 ón   • U R                  5       nUS0nU R                  X R                  5          5        g)zm
C{__hash__} can be used to get a hash of an address, even one referring
to L{None} rather than a real path.
TNr   r   s      r   Útest_emptyHashÚ$EmptyUNIXAddressTests.test_emptyHashò   r    r   )ru   r†   N)r2   r3   r4   r5   rL   rA   rw   r   r"   r   r”   r�   r¢   r6   r1   r   r   r–   r–   Í   s@   † ñð '€Nò,ò!ò0ñ ˆKÐ=Ó>ñ	Uó ?ð	Uõ0r   r–   )r‡   ÚsocketÚunittestr   Útwisted.internet.addressr   r   r   r   Útwisted.python.compatr   Útwisted.python.runtimer	   Útwisted.trial.unittestr
   r   Ú_supportsSymlinksr”   ÚAF_UNIXÚunixSkipÚAttributeErrorr   r8   rC   rN   r^   rf   rn   r–   r1   r   r   Ú<module>r®      s  ðó
 
Û Ý ÷ó õ /Ý +ß @à×,Ò,Ó.Ô.€ðØ
‡N‚Nð €H÷(+ñ (+ôVFÐ3ô Fô2˜8Ð%9ô 2ô02Ð-Ð/Gô 2ô 2Ð-Ð/Gô 2ô ,Ð*Ð,@ô ,ñ$ ˆÐ:Ó;ô3Ð*ó 3ó <ð3ñl ˆÐ:Ó;ô+0Ð/Ð1Eó +0ó <ñ+0øðo ó Ø‚Hðús   ÁC	 Ã	CÃC