Current File : //usr/lib/python3/dist-packages/twisted/words/test/__pycache__/test_jabberjid.cpython-312.pyc |
�
Ϫ�f� � � � d Z ddlmZ ddlmZ G d� dej
� Z G d� dej
� Z G d� d ej
� Zy
)z2
Tests for L{twisted.words.protocols.jabber.jid}.
� )�unittest)�jidc �D � e Zd Zd d�Zd d�Zd d�Zd d�Zd d�Zd d�Zd d�Z y)
�JIDParsingTestsNc �� � | j t j d� d� | j t j d� d� | j t j d� d� | j t j d� d� | j t j d � d
� | j t j d� d� | j t j d
� d� | j t j d� d� | j t j d� d� | j t j d� d� y)z/
Test different forms of JIDs.
�user@host/resource��user�host�resource� user@host�r
r Nr �Nr N�
host/resource�Nr r zfoo/bar@baz)N�foo�bar@bazzboo@foo/bar@baz)�boor r zboo@foo/bar/baz)r r zbar/bazzboo/foo@bar@baz)Nr zfoo@bar@bazzboo/foo/bar)Nr zfoo/barzboo//foo)Nr z/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 � | j t j t j d� y)z3
Test for failure on no host part.
zuser@N��assertRaisesr �
InvalidFormatr r s r �test_noHostzJIDParsingTests.test_noHost s � �
���#�+�+�S�Y�Y��@r c �b � | j t j t j d� 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@@hostNr r s r �
test_doubleAtzJIDParsingTests.test_doubleAt% s � �
���#�+�+�S�Y�Y��Er c �b � | j t j t j d� 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@hostNr r s r �test_multipleAtzJIDParsingTests.test_multipleAt. s! � �
���#�+�+�S�Y�Y�8H�Ir c �R � | j t j ddd� d� y)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�H�V�V�Z�0�2N�
r c �R � | j t j ddd� d� y)z@
Test case mapping of the host part of the JID.
r
�hoSTr r Nr'