%PDF- %PDF-
Mini Shell

Mini Shell

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

�

Ϫ�f����dZddlmZddlmZddlmZdZGd�dej�Z	Gd�d	ej�Z
Gd
�dej�ZGd�d
ej�ZGd�dej�Z
y)z#
Tests for L{twisted.python.text}.
�)�StringIO)�text)�unittesta�Every attempt to employ mathematical methods in the study of chemical
questions must be considered profoundly irrational and contrary to the
spirit of chemistry ...  If mathematical analysis should ever hold a
prominent place in chemistry - an aberration which is happily almost
impossible - it would occasion a rapid and widespread degeneration of that
science.

           --  Auguste Comte, Philosophie Positive, Paris, 1838
c�8�eZdZdZdd�Zdd�Zdd�Zdd�Zdd�Zy)	�	WrapTestsz'
    Tests for L{text.greedyWrap}.
    Nc��d|_tj�|_t	j
t|j�|_y)N�H)�	lineWidth�
sampleText�split�sampleSplitTextr�wordWrap�output��selfs �8/usr/lib/python3/dist-packages/twisted/test/test_text.py�setUpzWrapTests.setUps0�����)�/�/�1����m�m�J����?���c���g}|jD]!}|j|j���#t|�}t|j�}|j||�y)z.
        Compare the number of words.
        N)r�extendr�lenr
�assertEqual)r�words�line�	wordCount�sampleTextWordCounts     r�test_wordCountzWrapTests.test_wordCount"sY�����K�K�	'�D��L�L�����&�	'���J�	�!�$�"6�"6�7������$7�8rc��g}|jD]!}|j|j���#|j|j|k(�y)z-
        Compare the lists of words.
        N)rrr�
assertTruer
)rrrs   r�test_wordMatchzWrapTests.test_wordMatch.sG�����K�K�	'�D��L�L�����&�	'�
	
����,�,��5�6rc��g}|jD]5}t|�|jkr�|jt|���7|r?|j	dt|�t|j�|j|fz�yy)z0
        Check the length of the lines.
        z%%d of %d lines were too long.
%d < %sN)rrr
�append�fail)r�failuresrs   r�test_lineLengthzWrapTests.test_lineLength:sz�����K�K�	+�D��t�9����.�����D�	�*�	+���I�I�� ��]�C����,<�d�n�n�h�W�X�
�rc�p�d}tj||j�}|j|gd��y)z7
        Allow paragraphs delimited by two 
s.
        zet

phone
home.)�et�zphone home.r(N)rrr
r)rr�results   r�test_doubleNewlinezWrapTests.test_doubleNewlineIs.��*�
����z�4�>�>�:������!>�?r��returnN)	�__name__�
__module__�__qualname__�__doc__rrr r%r*�rrrrs"���@�

9�
7�
�@rrc� �eZdZdZdd�Zdd�Zy)�	LineTestsz8
    Tests for L{isMultiline} and L{endsInNewline}.
    Nc��d}tj|�}|j|�d}tj|�}|j|�y)zX
        L{text.isMultiline} returns C{True} if the string has a newline in it.
        zThis code
 "breaks."zThis code does not "break."N)r�isMultiliner�assertFalse�r�s�ms   r�test_isMultilinezLineTests.test_isMultilineWsH��
$�����Q��������)�����Q�������rc��d}tj|�}|j|�d}tj|�}|j|�y)zX
        L{text.endsInNewline} returns C{True} if the string ends in a newline.
        znewline
�oldlineN)r�
endsInNewlinerr6r7s   r�test_endsInNewlinezLineTests.test_endsInNewlinecsH��
�����q�!������������q�!������rr+)r-r.r/r0r:r>r1rrr3r3Rs���
�
rr3c�(�eZdZdZdd�Zdd�Zdd�Zy)�StringyStringTestsz*
    Tests for L{text.stringyString}.
    Nc�V�d}tj|�}|j|d�y)zA
        Tuple elements are displayed on separate lines.
        )�a�bz	(a,
 b,)
N�r�
stringyStringrr7s   r�
test_tuplezStringyStringTests.test_tupleus)��
�����q�!������M�*rc�Z�ddi}tj|�}|j|d�y)z>
        Dicts elements are displayed using C{str()}.
        rBrz{a: 0}NrDr7s   r�	test_dictzStringyStringTests.test_dict}s-���!�H�����q�!������H�%rc�Z�ddg}tj|�}|j|d�y)zO
        List elements are displayed on separate lines using C{str()}.
        rBrCz	[a,
 b,]
NrDr7s   r�	test_listzStringyStringTests.test_list�s-���#�J�����q�!������M�*rr+)r-r.r/r0rFrHrJr1rrr@r@ps���+�&�+rr@c� �eZdZdZdd�Zdd�Zy)�
SplitTestsz(
    Tests for L{text.splitQuoted}.
    Nc�Z�d}tj|�}|jgd�|�y)z:
        Splitting strings with one-word phrases.
        zThis code "works.")�This�codezworks.N�r�splitQuotedr�rr8�rs   r�test_oneWordzSplitTests.test_oneWord�s*��
!�����Q������3�Q�7rc�Z�d}tj|�}|jgd�|�y)NzThe "hairy monkey" likes pie.)�Thezhairy monkey�likeszpie.rPrRs   r�test_multiWordzSplitTests.test_multiWord�s(��+�����Q������A�1�Err+)r-r.r/r0rTrXr1rrrLrL�s���8�FrrLc��eZdZdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Z	dd	�Z
dd
�Zdd�Zdd�Z
dd
�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zy)�StrFileTestsNc�$�td�|_y�Nzthis is a test string)r�iors rrzStrFileTests.setUp�s���2�3��rc��y)Nr1rs r�tearDownzStrFileTests.tearDown�s��rc�b�|jtjd|j��y)N�x�r6r�strFiler]rs r�test_1_fzStrFileTests.test_1_f�s��������c�4�7�7�3�4rc�b�|jtjd|j��y)N�t�rrrcr]rs r�test_1_1zStrFileTests.test_1_1����������S�$�'�'�2�3rc�b�|jtjd|j��y)N�hrgrs r�test_1_2zStrFileTests.test_1_2�rirc�b�|jtjd|j��y)N�irgrs r�test_1_3zStrFileTests.test_1_3�rirc�b�|jtjd|j��y)Nr8rgrs r�test_1_4zStrFileTests.test_1_4�rirc�b�|jtjd|j��y)N�nrgrs r�test_1_5zStrFileTests.test_1_5�rirc�b�|jtjd|j��y)N�grgrs r�test_1_6zStrFileTests.test_1_6�rirc�b�|jtjd|j��y)N�thirgrs r�test_3_1zStrFileTests.test_3_1����������U�D�G�G�4�5rc�b�|jtjd|j��y)N�hisrgrs r�test_3_2zStrFileTests.test_3_2�r{rc�b�|jtjd|j��y)Nzis rgrs r�test_3_3zStrFileTests.test_3_3�r{rc�b�|jtjd|j��y)N�ingrgrs r�test_3_4zStrFileTests.test_3_4�r{rc�b�|jtjd|j��y)N�blarbrs r�test_3_fzStrFileTests.test_3_f�s��������e�T�W�W�5�6rc�b�|jtjd|j��y)Nzthis is a testrgrs r�test_large_1zStrFileTests.test_large_1�s��������%5�t�w�w�?�@rc�b�|jtjd|j��y)Nzis a test stringrgrs r�test_large_2zStrFileTests.test_large_2�s��������%7����A�Brc�b�|jtjd|j��y)Nzds jhfsa k fdasrbrs r�test_large_fzStrFileTests.test_large_f�s ��������&7����A�Brc�b�|jtjd|j��y)Nz-djhsakj dhsa fkhsa s,mdbnfsauiw bndasdf hreewrbrs r�test_overlarge_fzStrFileTests.test_overlarge_f�s#������L�L�H�$�'�'�R�	
rc�b�|jtjd|j��yr\rgrs r�	test_selfzStrFileTests.test_self�s��������%<�d�g�g�F�Grc�d�|jtjd|jd��y)NzThIs is A test STRINGFrgrs r�test_insensitivezStrFileTests.test_insensitive�s ��������%<�d�g�g�u�M�Nrr+)r-r.r/rr_rdrhrlrorqrtrwrzr~r�r�r�r�r�r�r�r�r�r1rrrZrZ�sk��4�
�5�4�4�4�4�4�4�6�6�6�6�7�A�C�C�
�
H�OrrZN)r0r]r�twisted.pythonr�
twisted.trialrr�TestCaserr3r@rLrZr1rr�<module>r�s~�����"��
�7@��!�!�7@�t��!�!��<+��*�*�+�<F��"�"�F�@=O�8�$�$�=Or

Zerion Mini Shell 1.0