HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib/python3/dist-packages/twisted/words/test/__pycache__/test_jabberxmppstringprep.cpython-38.pyc
U


W[��@sHddlmZddlmZmZmZGdd�dej�ZGdd�dej�ZdS)�)�unittest)�nodeprep�resourceprep�nameprepc@seZdZdZdd�ZdS)�DeprecationTestszL
    Deprecations in L{twisted.words.protocols.jabber.xmpp_stringprep}.
    cCsdddlm}|j|jgd�}|�t|dd�|�d|dd�|�dt|��|�|d�d	S)
zX
        L{xmpp_stringprep.crippled} is deprecated and always returns C{False}.
        r)�crippled)ZoffendingFunctions�categoryzrtwisted.words.protocols.jabber.xmpp_stringprep.crippled was deprecated in Twisted 13.1.0: crippled is always False�message�FN)�.twisted.words.protocols.jabber.xmpp_stringpreprZ
flushWarnings�
test_crippled�assertEqual�DeprecationWarning�len)�selfr�warnings�r�N/usr/lib/python3/dist-packages/twisted/words/test/test_jabberxmppstringprep.pyrs�
�zDeprecationTests.test_crippledN)�__name__�
__module__�__qualname__�__doc__rrrrrrsrc@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�XMPPStringPrepTestsa�
    The nodeprep stringprep profile is similar to the resourceprep profile,
    but does an extra mapping of characters (table B.2) and disallows
    more characters (table C.1.1 and eight extra punctuation characters).
    Due to this similarity, the resourceprep tests are more extensive, and
    the nodeprep tests only address the mappings additional restrictions.

    The nameprep profile is nearly identical to the nameprep implementation in
    L{encodings.idna}, but that implementation assumes the C{UseSTD4ASCIIRules}
    flag to be false. This implementation assumes it to be true, and restricts
    the allowed set of characters.  The tests here only check for the
    differences.
    cCs
|�t�d�d�|�t�d�d�|�t�d�d�|�t�d�d�|�t�d�d�|�t�d�d�|�ttjd	�|�t�d
�d�|�t�d�d�|�ttjd
�|�ttjd�|�ttjd�|�t�d�d�|�ttjd�|�ttjd�|�ttjd�|�ttjd�|�ttjd�|�ttjd�|�ttjd�|�ttjd�|�t�d�d�|�ttjd�|�ttjd�|�ttjd�|�ttjd�|�ttjd�|�ttjd �|�ttjd!�|�t�d"�d"�|�ttjd#�dS)$N�resourceZResource� u	Henry ⅣzHenry IVu%foo­͏᠆᠋bar​⁠baz︀︈️Z	foobarbaz� u u u​�z�…u᠎uuu󱈴u􏈴u򏿾u􏿿u�u�u⿵úúu‎u‪u󠀁u󠁂ufoo־baru	fooﵐbaruا1uا1بu󠀂)r
r�prepareZassertNotEqual�assertRaises�UnicodeError�rrrr�testResourcePrep/sF��z$XMPPStringPrepTests.testResourcePrepcCs8|�t�d�d�|�t�d�d�|�ttjd�dS)N�userZUserzus&er)r
rrrr r!rrr�testNodePrepXsz XMPPStringPrepTests.testNodePrepcCs|�ttjd�dS)zQ
        Make sure unassigned code points from Unicode 3.2 are rejected.
        uᴹN)rr rrr!rrr�"test_nodeprepUnassignedInUnicode32^sz6XMPPStringPrepTests.test_nodeprepUnassignedInUnicode32cCsj|�t�d�d�|�t�d�d�|�ttjd�|�ttjd�|�ttjd�|�t�d�d�dS)Nzexample.comzExample.comzex@mple.comz-example.comzexample-.comustraße.example.comzstrasse.example.com)r
rrrr r!rrr�testNamePrepes�z XMPPStringPrepTests.testNamePrepcCs|�t�d�d�dS)z>
        A trailing dot in domain names is preserved.
        zexample.com.N)r
rrr!rrr�test_nameprepTrailingDotosz,XMPPStringPrepTests.test_nameprepTrailingDotN)	rrrrr"r$r%r&r'rrrrr s)
rN)	Z
twisted.trialrrrrrZTestCaserrrrrr�<module>s