§
    Étºf¨  ã                   ó”   — d Z ddlmZ ddlmZ  G d„ dej        ¦  «        Z G d„ dej        ¦  «        Z G d„ d	ej        ¦  «        Zd
S )z2
Tests for L{twisted.words.protocols.jabber.jid}.
é    )Úunittest)Újidc                   óF   — e Zd Zd
d„Zd
d„Zd
d„Zd
d„Zd
d„Zd
d„Zd
d	„Z	dS )ÚJIDParsingTestsÚreturnNc                 ó&  — |                       t          j        d¦  «        d¦  «         |                       t          j        d¦  «        d¦  «         |                       t          j        d¦  «        d¦  «         |                       t          j        d¦  «        d¦  «         |                       t          j        d	¦  «        d
¦  «         |                       t          j        d¦  «        d¦  «         |                       t          j        d¦  «        d¦  «         |                       t          j        d¦  «        d¦  «         |                       t          j        d¦  «        d¦  «         |                       t          j        d¦  «        d¦  «         dS )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    ú`/var/www/surfInsights/venv3-11/lib/python3.11/site-packages/twisted/words/test/test_jabberjid.pyÚ
test_parsezJIDParsingTests.test_parse   sZ  € ð
 	×Ò�œÐ#7Ñ8Ô8Ð:VÑWÔWÐWØ×Ò�œ ;Ñ/Ô/Ð1GÑHÔHÐHØ×Ò�œ 6Ñ*Ô*Ð,@ÑAÔAÐAØ×Ò�œ ?Ñ3Ô3Ð5OÑPÔPÐPð 	×Ò�œ =Ñ1Ô1Ð3KÑLÔLÐLØ×Ò�œÐ#4Ñ5Ô5Ð7PÑQÔQÐQØ×Ò�œÐ#4Ñ5Ô5Ð7PÑQÔQÐQØ×Ò�œÐ#4Ñ5Ô5Ð7SÑTÔTÐTØ×Ò�œ =Ñ1Ô1Ð3KÑLÔLÐLØ×Ò�œ :Ñ.Ô.Ð0EÑFÔFÐFÐFÐFó    c                 ó\   — |                       t          j        t          j        d¦  «         dS )z3
        Test for failure on no host part.
        zuser@N©ÚassertRaisesr   ÚInvalidFormatr   r   s    r   Útest_noHostzJIDParsingTests.test_noHost   s'   € ð 	×Ò�#Ô+­S¬Y¸Ñ@Ô@Ð@Ð@Ð@r   c                 ó\   — |                       t          j        t          j        d¦  «         dS )z˜
        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_doubleAtzJIDParsingTests.test_doubleAt%   s'   € ð 	×Ò�#Ô+­S¬Y¸ÑEÔEÐEÐEÐEr   c                 ó\   — |                       t          j        t          j        d¦  «         dS )z•
        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_multipleAtzJIDParsingTests.test_multipleAt.   s(   € ð 	×Ò�#Ô+­S¬YÐ8HÑIÔIÐIÐIÐIr   c                 óZ   — |                       t          j        ddd¦  «        d¦  «         dS )z@
        Test case mapping of the user part of the JID.
        ÚUsErr   r   r
   N©r   r   Úprepr   s    r   Útest_prepCaseMapUserz$JIDParsingTests.test_prepCaseMapUser:   ó:   € ð 	×ÒÝŒH�V˜V ZÑ0Ô0Ð2Nñ	
ô 	
ð 	
ð 	
ð 	
r   c                 óZ   — |                       t          j        ddd¦  «        d¦  «         dS )z@
        Test case mapping of the host part of the JID.
        r   ÚhoSTr   r
   Nr(   r   s    r   Útest_prepCaseMapHostz$JIDParsingTests.test_prepCaseMapHostB   r+   r   c                 ó®   — |                       t          j        ddd¦  «        d¦  «         |                      t          j        ddd¦  «        d¦  «         dS )zH
        Test no case mapping of the resourcce part of the JID.
        r   r-   r   r
   r   ÚResourceN)r   r   r)   ÚassertNotEqualr   s    r   Útest_prepNoCaseMapResourcez*JIDParsingTests.test_prepNoCaseMapResourceJ   sh   € ð 	×ÒÝŒH�V˜V ZÑ0Ô0Ð2Nñ	
ô 	
ð 	
ð 	×ÒÝŒH�V˜V ZÑ0Ô0Ð2Nñ	
ô 	
ð 	
ð 	
ð 	
r   ©r   N)
Ú__name__Ú
__module__Ú__qualname__r   r!   r#   r%   r*   r.   r2   © r   r   r   r      s°   € € € € € ðGð Gð Gð Gð$Að Að Að AðFð Fð Fð FðJð Jð Jð Jð
ð 
ð 
ð 
ð
ð 
ð 
ð 
ð	
ð 	
ð 	
ð 	
ð 	
ð 	
r   r   c                   ó–   — e Zd Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd	„Z	dd
„Z
dd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„ZdS )ÚJIDTestsr   Nc                 óP   — |                       t          t          j        ¦  «         dS )zC
        Test that using no arguments raises an exception.
        N)r   ÚRuntimeErrorr   ÚJIDr   s    r   Útest_noneArgumentszJIDTests.test_noneArgumentsW   s"   € ð 	×Ò�,­¬Ñ0Ô0Ð0Ð0Ð0r   c                 óÐ   — t          j        d¦  «        }|                      |j        d¦  «         |                      |j        d¦  «         |                      |j        d¦  «         dS )zI
        Test that the attributes correspond with the JID parts.
        r	   r   r   r   N)r   r<   r   r   r   r   ©r   Újs     r   Útest_attributeszJIDTests.test_attributes]   sb   € õ ŒGÐ(Ñ)Ô)ˆØ×Ò˜œ Ñ(Ô(Ð(Ø×Ò˜œ Ñ(Ô(Ð(Ø×Ò˜œ ZÑ0Ô0Ð0Ð0Ð0r   c                 ó~   — t          j        d¦  «        }|                      d|                     ¦   «         ¦  «         dS )z6
        Test the extraction of the bare JID.
        r	   r   N©r   r<   r   Úuserhostr?   s     r   Útest_userhostzJIDTests.test_userhostf   s8   € õ ŒGÐ(Ñ)Ô)ˆØ×Ò˜ a§j¢j¡l¤lÑ3Ô3Ð3Ð3Ð3r   c                 ó~   — t          j        d¦  «        }|                      d|                     ¦   «         ¦  «         dS )zU
        Test the extraction of the bare JID of the full form host/resource.
        r   r   NrC   r?   s     r   Útest_userhostOnlyHostzJIDTests.test_userhostOnlyHostm   s7   € õ ŒG�OÑ$Ô$ˆØ×Ò˜ §¢¡¤Ñ.Ô.Ð.Ð.Ð.r   c                 ó¦   — t          j        d¦  «        }t          j        d¦  «        }|                      ||                     ¦   «         ¦  «         dS )z<
        Test getting a JID object of the bare JID.
        r	   r   N)r   r<   Ú	internJIDÚassertIdenticalÚuserhostJID©r   Új1Új2s      r   Útest_userhostJIDzJIDTests.test_userhostJIDt   sI   € õ ŒWÐ)Ñ*Ô*ˆÝŒ]˜;Ñ'Ô'ˆØ×Ò˜R §¢Ñ!1Ô!1Ñ2Ô2Ð2Ð2Ð2r   c                 ó~   — t          j        d¦  «        }|                      ||                     ¦   «         ¦  «         dS )zW
        Test getting a JID object of the bare JID when there was no resource.
        r   N)r   r<   rJ   rK   r?   s     r   Útest_userhostJIDNoResourcez#JIDTests.test_userhostJIDNoResource|   s7   € õ ŒG�KÑ Ô ˆØ×Ò˜Q §¢¡¤Ñ0Ô0Ð0Ð0Ð0r   c                 ó€   — t          j        d¬¦  «        }|                      d|                     ¦   «         ¦  «         dS )zW
        Test giving a string representation of the JID with only a host part.
        r   ©Útupler   N©r   r<   r   Úfullr?   s     r   Útest_fullHostzJIDTests.test_fullHostƒ   s;   € õ ŒGÐ.Ð/Ñ/Ô/ˆØ×Ò˜ §¢¡¤Ñ*Ô*Ð*Ð*Ð*r   c                 ó€   — t          j        d¬¦  «        }|                      d|                     ¦   «         ¦  «         dS )zU
        Test giving a string representation of the JID with host, resource.
        r   rS   r   NrU   r?   s     r   Útest_fullHostResourcezJIDTests.test_fullHostResourceŠ   s;   € õ ŒGÐ4Ð5Ñ5Ô5ˆØ×Ò˜¨!¯&ª&©(¬(Ñ3Ô3Ð3Ð3Ð3r   c                 ó€   — t          j        d¬¦  «        }|                      d|                     ¦   «         ¦  «         dS )zQ
        Test giving a string representation of the JID with user, host.
        r   rS   r   NrU   r?   s     r   Útest_fullUserHostzJIDTests.test_fullUserHost‘   s;   € õ ŒGÐ0Ð1Ñ1Ô1ˆØ×Ò˜ a§f¢f¡h¤hÑ/Ô/Ð/Ð/Ð/r   c                 ó€   — t          j        d¬¦  «        }|                      d|                     ¦   «         ¦  «         dS )zA
        Test giving a string representation of the JID.
        r
   rS   r	   NrU   r?   s     r   Útest_fullAllzJIDTests.test_fullAll˜   s<   € õ ŒGÐ6Ð7Ñ7Ô7ˆØ×ÒÐ-¨q¯vªv©x¬xÑ8Ô8Ð8Ð8Ð8r   c                 ó®   — t          j        d¦  «        }t          j        d¦  «        }|                      ||¦  «         |                      ||¦  «         dS ©z$
        Test JID equality.
        r	   N)r   r<   ÚassertNotIdenticalr   rL   s      r   Útest_equalityzJIDTests.test_equalityŸ   sV   € õ ŒWÐ)Ñ*Ô*ˆÝŒWÐ)Ñ*Ô*ˆØ×Ò  BÑ'Ô'Ð'Ø×Ò˜˜RÑ Ô Ð Ð Ð r   c                 ó`   — t          j        d¦  «        }|                      |dk    ¦  «         dS r_   )r   r<   ÚassertFalser?   s     r   Útest_equalityWithNonJIDsz!JIDTests.test_equalityWithNonJIDs¨   s4   € õ ŒGÐ(Ñ)Ô)ˆØ×Ò˜Ð2Ò2Ñ3Ô3Ð3Ð3Ð3r   c                 ó‚   — t          j        d¦  «        }t          j        d¦  «        }|                      ||¦  «         dS )z&
        Test JID inequality.
        zuser1@host/resourcezuser2@host/resourceN©r   r<   r1   rL   s      r   Útest_inequalityzJIDTests.test_inequality¯   s@   € õ ŒWÐ*Ñ+Ô+ˆÝŒWÐ*Ñ+Ô+ˆØ×Ò˜B Ñ#Ô#Ð#Ð#Ð#r   c                 óZ   — t          j        d¦  «        }|                      |d¦  «         dS r_   rf   r?   s     r   Útest_inequalityWithNonJIDsz#JIDTests.test_inequalityWithNonJIDs·   s1   € õ ŒGÐ(Ñ)Ô)ˆØ×Ò˜AÐ3Ñ4Ô4Ð4Ð4Ð4r   c                 ó¶   — t          j        d¦  «        }t          j        d¦  «        }|                      t          |¦  «        t          |¦  «        ¦  «         dS )z'
        Test JID hashability.
        r	   N)r   r<   r   ÚhashrL   s      r   Útest_hashablezJIDTests.test_hashable¾   sL   € õ ŒWÐ)Ñ*Ô*ˆÝŒWÐ)Ñ*Ô*ˆØ×Ò�˜b™œ¥4¨¡8¤8Ñ,Ô,Ð,Ð,Ð,r   c                 óv   — t          j        d¬¦  «        }|                      dt          |¦  «        ¦  «         dS )z6
        Test unicode representation of JIDs.
        r
   rS   r	   N)r   r<   r   Ústrr?   s     r   Útest_strzJIDTests.test_strÆ   s:   € õ ŒGÐ6Ð7Ñ7Ô7ˆØ×ÒÐ-­s°1©v¬vÑ6Ô6Ð6Ð6Ð6r   c                 ó–   — t          j        d¬¦  «        }|                      dt          d¦  «        z  t          |¦  «        ¦  «         dS )z5
        Test representation of JID objects.
        r
   rS   zJID(%s)r	   N)r   r<   r   Úreprr?   s     r   Ú	test_reprzJIDTests.test_reprÍ   sG   € õ ŒGÐ6Ð7Ñ7Ô7ˆØ×Ò˜¥TÐ*>Ñ%?Ô%?Ñ?ÅÀaÁÄÑIÔIÐIÐIÐIr   r3   )r4   r5   r6   r=   rA   rE   rG   rO   rQ   rW   rY   r[   r]   ra   rd   rg   ri   rl   ro   rr   r7   r   r   r9   r9   V   sn  € € € € € ð1ð 1ð 1ð 1ð1ð 1ð 1ð 1ð4ð 4ð 4ð 4ð/ð /ð /ð /ð3ð 3ð 3ð 3ð1ð 1ð 1ð 1ð+ð +ð +ð +ð4ð 4ð 4ð 4ð0ð 0ð 0ð 0ð9ð 9ð 9ð 9ð!ð !ð !ð !ð4ð 4ð 4ð 4ð$ð $ð $ð $ð5ð 5ð 5ð 5ð-ð -ð -ð -ð7ð 7ð 7ð 7ðJð Jð Jð Jð Jð Jr   r9   c                   ó   — e Zd Zdd„ZdS )ÚInternJIDTestsr   Nc                 ó‚   — t          j        d¦  «        }t          j        d¦  «        }|                      ||¦  «         dS )zD
        Test that two interned JIDs yield the same object.
        r   N)r   rI   rJ   rL   s      r   Útest_identityzInternJIDTests.test_identityÖ   s>   € õ Œ]˜;Ñ'Ô'ˆÝŒ]˜;Ñ'Ô'ˆØ×Ò˜R Ñ$Ô$Ð$Ð$Ð$r   r3   )r4   r5   r6   rv   r7   r   r   rt   rt   Õ   s(   € € € € € ð%ð %ð %ð %ð %ð %r   rt   N)	Ú__doc__Útwisted.trialr   Útwisted.words.protocols.jabberr   ÚTestCaser   r9   rt   r7   r   r   ú<module>r{      sà   ððð ð #Ð "Ð "Ð "Ð "Ð "Ø .Ð .Ð .Ð .Ð .Ð .ðG
ð G
ð G
ð G
ð G
�hÔ'ñ G
ô G
ð G
ðT|Jð |Jð |Jð |Jð |JˆxÔ ñ |Jô |Jð |Jð~%ð %ð %ð %ð %�XÔ&ñ %ô %ð %ð %ð %r   