%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/twisted/words/test/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/twisted/words/test/__pycache__/test_jabberjid.cpython-312.pyc

�

Ϫ�f����dZddlmZddlmZGd�dej
�ZGd�dej
�ZGd�d	ej
�Zy
)z2
Tests for L{twisted.words.protocols.jabber.jid}.
�)�unittest)�jidc�D�eZdZd	d�Zd	d�Zd	d�Zd	d�Zd	d�Zd	d�Zd	d�Z	y)
�JIDParsingTestsNc���|jtjd�d�|jtjd�d�|jtjd�d�|jtjd�d�|jtjd	�d
�|jtjd�d�|jtjd
�d�|jtjd�d�|jtjd�d�|jtjd�d�y)z/
        Test different forms of JIDs.
        �user@host/resource��user�host�resource�	user@host�r
rNr�NrN�
host/resource�Nrrzfoo/bar@baz)N�foo�bar@bazzboo@foo/bar@baz)�boorrzboo@foo/bar/baz)rrzbar/bazzboo/foo@bar@baz)Nrzfoo@bar@bazzboo/foo/bar)Nrzfoo/barzboo//foo)Nrz/fooN)�assertEqualr�parse��selfs �C/usr/lib/python3/dist-packages/twisted/words/test/test_jabberjid.py�
test_parsezJIDParsingTests.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�|jtjtjd�y)z3
        Test for failure on no host part.
        zuser@N��assertRaisesr�
InvalidFormatrrs r�test_noHostzJIDParsingTests.test_noHosts ��	
���#�+�+�S�Y�Y��@rc�b�|jtjtjd�y)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@@hostNrrs r�
test_doubleAtzJIDParsingTests.test_doubleAt%s ��	
���#�+�+�S�Y�Y��Erc�b�|jtjtjd�y)z�
        Test for failure on two @ signs.

        This should fail because @ is not a valid character for the host
        part of the JID.
        zuser@host@hostNrrs r�test_multipleAtzJIDParsingTests.test_multipleAt.s!��	
���#�+�+�S�Y�Y�8H�Irc�R�|jtjddd�d�y)z@
        Test case mapping of the user part of the JID.
        �UsErrrr	N�rr�preprs r�test_prepCaseMapUserz$JIDParsingTests.test_prepCaseMapUser:�%��	
����H�H�V�V�Z�0�2N�	
rc�R�|jtjddd�d�y)z@
        Test case mapping of the host part of the JID.
        r
�hoSTrr	Nr'rs r�test_prepCaseMapHostz$JIDParsingTests.test_prepCaseMapHostBr*rc��|jtjddd�d�|jtjddd�d�y)zH
        Test no case mapping of the resourcce part of the JID.
        r
r,rr	r�ResourceN)rrr(�assertNotEqualrs r�test_prepNoCaseMapResourcez*JIDParsingTests.test_prepNoCaseMapResourceJsH��	
����H�H�V�V�Z�0�2N�	
�	
����H�H�V�V�Z�0�2N�	
r��returnN)
�__name__�
__module__�__qualname__rr r"r$r)r-r1�rrrrs)��G�$A�F�J�
�
�	
rrc��eZdZdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Z	dd	�Z
dd
�Zdd�Zdd�Z
dd
�Zdd�Zdd�Zdd�Zdd�Zdd�Zy)�JIDTestsNc�L�|jttj�y)zC
        Test that using no arguments raises an exception.
        N)r�RuntimeErrorr�JIDrs r�test_noneArgumentszJIDTests.test_noneArgumentsWs��	
���,����0rc���tjd�}|j|jd�|j|jd�|j|j
d�y)zI
        Test that the attributes correspond with the JID parts.
        rr
rrN)rr<rr
rr�r�js  r�test_attributeszJIDTests.test_attributes]sO��
�G�G�(�)���������(��������(�������Z�0rc�n�tjd�}|jd|j��y)z6
        Test the extraction of the bare JID.
        rr
N�rr<r�userhostr?s  r�
test_userhostzJIDTests.test_userhostfs)��
�G�G�(�)������a�j�j�l�3rc�n�tjd�}|jd|j��y)zU
        Test the extraction of the bare JID of the full form host/resource.
        rrNrCr?s  r�test_userhostOnlyHostzJIDTests.test_userhostOnlyHostms(��
�G�G�O�$����������.rc��tjd�}tjd�}|j||j	��y)z<
        Test getting a JID object of the bare JID.
        rr
N)rr<�	internJID�assertIdentical�userhostJID�r�j1�j2s   r�test_userhostJIDzJIDTests.test_userhostJIDts8���W�W�)�
*��
�]�]�;�
'�����R����!1�2rc�n�tjd�}|j||j��y)zW
        Test getting a JID object of the bare JID when there was no resource.
        r
N)rr<rJrKr?s  r�test_userhostJIDNoResourcez#JIDTests.test_userhostJIDNoResource|s(��
�G�G�K� �����Q��
�
��0rc�p�tjd��}|jd|j��y)zW
        Test giving a string representation of the JID with only a host part.
        r��tuplerN�rr<r�fullr?s  r�
test_fullHostzJIDTests.test_fullHost�s)��
�G�G�.�/����������*rc�p�tjd��}|jd|j��y)zU
        Test giving a string representation of the JID with host, resource.
        rrSrNrUr?s  r�test_fullHostResourcezJIDTests.test_fullHostResource�s)��
�G�G�4�5������!�&�&�(�3rc�p�tjd��}|jd|j��y)zQ
        Test giving a string representation of the JID with user, host.
        rrSr
NrUr?s  r�test_fullUserHostzJIDTests.test_fullUserHost�s)��
�G�G�0�1������a�f�f�h�/rc�p�tjd��}|jd|j��y)zA
        Test giving a string representation of the JID.
        r	rSrNrUr?s  r�test_fullAllzJIDTests.test_fullAll�s*��
�G�G�6�7�����-�q�v�v�x�8rc��tjd�}tjd�}|j||�|j||�y�z$
        Test JID equality.
        rN)rr<�assertNotIdenticalrrLs   r�
test_equalityzJIDTests.test_equality�sB���W�W�)�
*��
�W�W�)�
*������B�'�����R� rc�V�tjd�}|j|dk(�yr_)rr<�assertFalser?s  r�test_equalityWithNonJIDsz!JIDTests.test_equalityWithNonJIDs�s'��
�G�G�(�)������2�2�3rc�|�tjd�}tjd�}|j||�y)z&
        Test JID inequality.
        zuser1@host/resourcezuser2@host/resourceN�rr<r0rLs   r�test_inequalityzJIDTests.test_inequality�s2���W�W�*�
+��
�W�W�*�
+�����B��#rc�R�tjd�}|j|d�yr_rfr?s  r�test_inequalityWithNonJIDsz#JIDTests.test_inequalityWithNonJIDs�s$��
�G�G�(�)�����A�3�4rc��tjd�}tjd�}|jt|�t|��y)z'
        Test JID hashability.
        rN)rr<r�hashrLs   r�
test_hashablezJIDTests.test_hashable�s:���W�W�)�
*��
�W�W�)�
*������b��4��8�,rc�f�tjd��}|jdt|��y)z6
        Test unicode representation of JIDs.
        r	rSrN)rr<r�strr?s  r�test_strzJIDTests.test_str�s(��
�G�G�6�7�����-�s�1�v�6rc�~�tjd��}|jdtd�zt|��y)z5
        Test representation of JID objects.
        r	rSzJID(%s)rN)rr<r�reprr?s  r�	test_reprzJIDTests.test_repr�s2��
�G�G�6�7������T�*>�%?�?��a��Irr2)r4r5r6r=rArErGrOrQrWrYr[r]rardrgrirlrorrr7rrr9r9VsX��1�1�4�/�3�1�+�4�0�9�!�4�$�5�-�7�Jrr9c��eZdZdd�Zy)�InternJIDTestsNc�|�tjd�}tjd�}|j||�y)zD
        Test that two interned JIDs yield the same object.
        r
N)rrIrJrLs   r�
test_identityzInternJIDTests.test_identity�s0���]�]�;�
'��
�]�]�;�
'�����R��$rr2)r4r5r6rvr7rrrtrt�s��%rrtN)	�__doc__�
twisted.trialr�twisted.words.protocols.jabberr�TestCaserr9rtr7rr�<module>r{sP���#�.�G
�h�'�'�G
�T|J�x� � �|J�~%�X�&�&�%r

Zerion Mini Shell 1.0