ó
    ×›‘h¨  ã                   óž   • S r SSKJr  SSKJr   " S S\R
                  5      r " S S\R
                  5      r " S S	\R
                  5      rg
)z2
Tests for L{twisted.words.protocols.jabber.jid}.
é    )Úunittest)Újidc                   óZ   • \ rS rSrSS jrSS jrSS jrSS jrSS jrSS jr	SS	 jr
S
rg)ÚJIDParsingTestsé   Nc                 óü  • U R                  [        R                  " S5      S5        U R                  [        R                  " S5      S5        U R                  [        R                  " S5      S5        U R                  [        R                  " S5      S5        U R                  [        R                  " S	5      S
5        U R                  [        R                  " S5      S5        U R                  [        R                  " S5      S5        U R                  [        R                  " S5      S5        U R                  [        R                  " S5      S5        U R                  [        R                  " S5      S5        g)z
Test different forms of JIDs.
úuser@host/resource©ÚuserÚhostÚresourceú	user@host©r   r   Nr   ©Nr   Núhost/resource©Nr   r   zfoo/bar@baz)NÚfooúbar@bazzboo@foo/bar@baz)Úboor   r   zboo@foo/bar/baz)r   r   zbar/bazzboo/foo@bar@baz)Nr   zfoo@bar@bazzboo/foo/bar)Nr   zfoo/barzboo//foo)Nr   z/fooN)ÚassertEqualr   Úparse©Úselfs    ÚeC:\Users\psant\Downloads\Noiseback\school\venv\Lib\site-packages\twisted/words/test/test_jabberjid.pyÚ
test_parseÚJIDParsingTests.test_parse   s  € ð
 	×ÑœŸšÐ#7Ó8Ð:VÔWØ×ÑœŸš ;Ó/Ð1GÔHØ×ÑœŸš 6Ó*Ð,@ÔAØ×ÑœŸš ?Ó3Ð5OÔPð 	×ÑœŸš =Ó1Ð3KÔLØ×ÑœŸšÐ#4Ó5Ð7PÔQØ×ÑœŸšÐ#4Ó5Ð7PÔQØ×ÑœŸšÐ#4Ó5Ð7SÔTØ×ÑœŸš =Ó1Ð3KÔLØ×ÑœŸš :Ó.Ð0EÕFó    c                 ób   • U R                  [        R                  [        R                  S5        g)z#
Test for failure on no host part.
zuser@N©ÚassertRaisesr   ÚInvalidFormatr   r   s    r   Útest_noHostÚJIDParsingTests.test_noHost   s    € ð 	×Ñœ#×+Ñ+¬S¯Y©Y¸Õ@r   c                 ób   • U R                  [        R                  [        R                  S5        g)zx
Test for failure on double @ signs.

This should fail because @ is not a valid character for the host
part of the JID.
z
user@@hostNr   r   s    r   Útest_doubleAtÚJIDParsingTests.test_doubleAt%   s    € ð 	×Ñœ#×+Ñ+¬S¯Y©Y¸ÕEr   c                 ób   • U R                  [        R                  [        R                  S5        g)zu
Test for failure on two @ signs.

This should fail because @ is not a valid character for the host
part of the JID.
zuser@host@hostNr   r   s    r   Útest_multipleAtÚJIDParsingTests.test_multipleAt.   s!   € ð 	×Ñœ#×+Ñ+¬S¯Y©YÐ8HÕIr   c                 óT   • U R                  [        R                  " SSS5      S5        g)z0
Test case mapping of the user part of the JID.
ÚUsErr   r   r
   N©r   r   Úprepr   s    r   Útest_prepCaseMapUserÚ$JIDParsingTests.test_prepCaseMapUser:   ó%   € ð 	×ÑÜ�HŠH�V˜V ZÓ0Ð2Nõ	
r   c                 óT   • U R                  [        R                  " SSS5      S5        g)z0
Test case mapping of the host part of the JID.
r   ÚhoSTr   r
   Nr,   r   s    r   Útest_prepCaseMapHostÚ$JIDParsingTests.test_prepCaseMapHostB   r0   r   c                 ó¤   • U R                  [        R                  " SSS5      S5        U R                  [        R                  " SSS5      S5        g)z8
Test no case mapping of the resourcce part of the JID.
r   r2   r   r
   r   ÚResourceN)r   r   r-   ÚassertNotEqualr   s    r   Útest_prepNoCaseMapResourceÚ*JIDParsingTests.test_prepNoCaseMapResourceJ   sH   € ð 	×ÑÜ�HŠH�V˜V ZÓ0Ð2Nô	
ð 	×ÑÜ�HŠH�V˜V ZÓ0Ð2Nõ	
r   © ©ÚreturnN)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r   r"   r%   r(   r.   r3   r8   Ú__static_attributes__r:   r   r   r   r      s)   † ôGô$AôFôJô
ô
÷	
r   r   c                   ó¾   • \ rS rSrSS jrSS jrSS jrSS jrSS jrSS jr	SS	 jr
SS
 jrSS jrSS jrSS jrSS jrSS jrSS jrSS jrSS jrSS jrSrg)ÚJIDTestséV   Nc                 óL   • U R                  [        [        R                  5        g)z3
Test that using no arguments raises an exception.
N)r    ÚRuntimeErrorr   ÚJIDr   s    r   Útest_noneArgumentsÚJIDTests.test_noneArgumentsW   s   € ð 	×Ñœ,¬¯©Õ0r   c                 óØ   • [         R                  " S5      nU R                  UR                  S5        U R                  UR                  S5        U R                  UR
                  S5        g)z9
Test that the attributes correspond with the JID parts.
r	   r   r   r   N)r   rG   r   r   r   r   ©r   Újs     r   Útest_attributesÚJIDTests.test_attributes]   sO   € ô �GŠGÐ(Ó)ˆØ×Ñ˜Ÿ™ Ô(Ø×Ñ˜Ÿ™ Ô(Ø×Ñ˜Ÿ™ ZÕ0r   c                 óp   • [         R                  " S5      nU R                  SUR                  5       5        g)z&
Test the extraction of the bare JID.
r	   r   N©r   rG   r   ÚuserhostrK   s     r   Útest_userhostÚJIDTests.test_userhostf   s)   € ô �GŠGÐ(Ó)ˆØ×Ñ˜ a§j¡j£lÕ3r   c                 óp   • [         R                  " S5      nU R                  SUR                  5       5        g)zE
Test the extraction of the bare JID of the full form host/resource.
r   r   NrP   rK   s     r   Útest_userhostOnlyHostÚJIDTests.test_userhostOnlyHostm   s(   € ô �GŠG�OÓ$ˆØ×Ñ˜ §¡£Õ.r   c                 óš   • [         R                  " S5      n[         R                  " S5      nU R                  X!R	                  5       5        g)z,
Test getting a JID object of the bare JID.
r	   r   N)r   rG   Ú	internJIDÚassertIdenticalÚuserhostJID©r   Új1Új2s      r   Útest_userhostJIDÚJIDTests.test_userhostJIDt   s6   € ô �WŠWÐ)Ó*ˆÜ�]Š]˜;Ó'ˆØ×Ñ˜R§¡Ó!1Õ2r   c                 ón   • [         R                  " S5      nU R                  XR                  5       5        g)zG
Test getting a JID object of the bare JID when there was no resource.
r   N)r   rG   rY   rZ   rK   s     r   Útest_userhostJIDNoResourceÚ#JIDTests.test_userhostJIDNoResource|   s&   € ô �GŠG�KÓ ˆØ×Ñ˜Q§¡£Õ0r   c                 ól   • [         R                  " SS9nU R                  SUR                  5       5        g)zG
Test giving a string representation of the JID with only a host part.
r   ©Útupler   N©r   rG   r   ÚfullrK   s     r   Útest_fullHostÚJIDTests.test_fullHostƒ   s)   € ô �GŠGÐ.Ñ/ˆØ×Ñ˜ §¡£Õ*r   c                 ól   • [         R                  " SS9nU R                  SUR                  5       5        g)zE
Test giving a string representation of the JID with host, resource.
r   rd   r   Nrf   rK   s     r   Útest_fullHostResourceÚJIDTests.test_fullHostResourceŠ   s)   € ô �GŠGÐ4Ñ5ˆØ×Ñ˜¨!¯&©&«(Õ3r   c                 ól   • [         R                  " SS9nU R                  SUR                  5       5        g)zA
Test giving a string representation of the JID with user, host.
r   rd   r   Nrf   rK   s     r   Útest_fullUserHostÚJIDTests.test_fullUserHost‘   s)   € ô �GŠGÐ0Ñ1ˆØ×Ñ˜ a§f¡f£hÕ/r   c                 ól   • [         R                  " SS9nU R                  SUR                  5       5        g)z1
Test giving a string representation of the JID.
r
   rd   r	   Nrf   rK   s     r   Útest_fullAllÚJIDTests.test_fullAll˜   s*   € ô �GŠGÐ6Ñ7ˆØ×ÑÐ-¨q¯v©v«xÕ8r   c                 ó    • [         R                  " S5      n[         R                  " S5      nU R                  X5        U R                  X5        g©z
Test JID equality.
r	   N)r   rG   ÚassertNotIdenticalr   r[   s      r   Útest_equalityÚJIDTests.test_equalityŸ   s>   € ô �WŠWÐ)Ó*ˆÜ�WŠWÐ)Ó*ˆØ×Ñ Ô'Ø×Ñ˜Õ r   c                 óX   • [         R                  " S5      nU R                  US:H  5        grt   )r   rG   ÚassertFalserK   s     r   Útest_equalityWithNonJIDsÚ!JIDTests.test_equalityWithNonJIDs¨   s'   € ô �GŠGÐ(Ó)ˆØ×Ñ˜Ð2Ñ2Õ3r   c                 ó~   • [         R                  " S5      n[         R                  " S5      nU R                  X5        g)z
Test JID inequality.
zuser1@host/resourcezuser2@host/resourceN©r   rG   r7   r[   s      r   Útest_inequalityÚJIDTests.test_inequality¯   s0   € ô �WŠWÐ*Ó+ˆÜ�WŠWÐ*Ó+ˆØ×Ñ˜BÕ#r   c                 óT   • [         R                  " S5      nU R                  US5        grt   r}   rK   s     r   Útest_inequalityWithNonJIDsÚ#JIDTests.test_inequalityWithNonJIDs·   s$   € ô �GŠGÐ(Ó)ˆØ×Ñ˜AÐ3Õ4r   c                 ó¤   • [         R                  " S5      n[         R                  " S5      nU R                  [        U5      [        U5      5        g)z
Test JID hashability.
r	   N)r   rG   r   Úhashr[   s      r   Útest_hashableÚJIDTests.test_hashable¾   s:   € ô �WŠWÐ)Ó*ˆÜ�WŠWÐ)Ó*ˆØ×Ñœ˜b›¤4¨£8Õ,r   c                 ób   • [         R                  " SS9nU R                  S[        U5      5        g)z&
Test unicode representation of JIDs.
r
   rd   r	   N)r   rG   r   ÚstrrK   s     r   Útest_strÚJIDTests.test_strÆ   s(   € ô �GŠGÐ6Ñ7ˆØ×ÑÐ-¬s°1«vÕ6r   c                 óz   • [         R                  " SS9nU R                  S[        S5      -  [        U5      5        g)z%
Test representation of JID objects.
r
   rd   zJID(%s)r	   N)r   rG   r   ÚreprrK   s     r   Ú	test_reprÚJIDTests.test_reprÍ   s2   € ô �GŠGÐ6Ñ7ˆØ×Ñ˜¤TÐ*>Ó%?Ñ?ÄÀaÃÕIr   r:   r;   )r=   r>   r?   r@   rH   rM   rR   rU   r^   ra   rh   rk   rn   rq   rv   rz   r~   r�   r…   r‰   r�   rA   r:   r   r   rC   rC   V   sX   † ô1ô1ô4ô/ô3ô1ô+ô4ô0ô9ô!ô4ô$ô5ô-ô7÷Jr   rC   c                   ó   • \ rS rSrSS jrSrg)ÚInternJIDTestséÕ   Nc                 ó~   • [         R                  " S5      n[         R                  " S5      nU R                  X5        g)z4
Test that two interned JIDs yield the same object.
r   N)r   rX   rY   r[   s      r   Útest_identityÚInternJIDTests.test_identityÖ   s.   € ô �]Š]˜;Ó'ˆÜ�]Š]˜;Ó'ˆØ×Ñ˜RÕ$r   r:   r;   )r=   r>   r?   r@   r“   rA   r:   r   r   r�   r�   Õ   s   † ÷%r   r�   N)	Ú__doc__Útwisted.trialr   Útwisted.words.protocols.jabberr   ÚTestCaser   rC   r�   r:   r   r   Ú<module>r™      sP   ðñõ #Ý .ôG
�h×'Ñ'ô G
ôT|Jˆx× Ñ ô |Jô~%�X×&Ñ&õ %r   