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: //usr/lib/python3/dist-packages/twisted/test/__pycache__/test_text.cpython-38.pyc
U


W[8�@s�dZddlmZddlmZddlmZdZGdd�dej	�Z
Gdd	�d	ej	�ZGd
d�dej	�ZGdd
�d
ej	�Z
Gdd�dej	�ZdS)z#
Tests for L{twisted.python.text}.
�)�NativeStringIO)�unittest)�texta�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@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�	WrapTestsz'
    Tests for L{text.greedyWrap}.
    cCs$d|_t��|_t�t|j�|_dS)N�H)�	lineWidth�
sampleText�split�sampleSplitTextr�wordWrap�output��self�r�8/usr/lib/python3/dist-packages/twisted/test/test_text.py�setUps
zWrapTests.setUpcCs@g}|jD]}|�|���q
t|�}t|j�}|�||�dS)z.
        Compare the number of words.
        N)r�extendr	�lenr
�assertEqual)r�words�lineZ	wordCountZsampleTextWordCountrrr�test_wordCount$s

zWrapTests.test_wordCountcCs2g}|jD]}|�|���q
|�|j|k�dS)z-
        Compare the lists of words.
        N)rrr	�
assertTruer
)rrrrrr�test_wordMatch1s
zWrapTests.test_wordMatchcCsVg}|jD] }t|�|jks
|�t|��q
|rR|�dt|�t|j�|j|f�dS)z0
        Check the length of the lines.
        z%%d of %d lines were too long.
%d < %sN)rrr�appendZfail)rZfailuresrrrr�test_lineLength>s
��zWrapTests.test_lineLengthcCs*d}t�||j�}|�|ddddg�dS)z7
        Allow paragraphs delimited by two 
s.
        zet

phone
home.Zet�zphone home.N)rrrr)rr�resultrrr�test_doubleNewlineLszWrapTests.test_doubleNewlineN)	�__name__�
__module__�__qualname__�__doc__rrrrrrrrrrs

rc@s eZdZdZdd�Zdd�ZdS)�	LineTestsz8
    Tests for L{isMultiline} and L{endsInNewline}.
    cCs4d}t�|�}|�|�d}t�|�}|�|�dS)zX
        L{text.isMultiline} returns C{True} if the string has a newline in it.
        zThis code
 "breaks."zThis code does not "break."N)rZisMultiliner�assertFalse�r�s�mrrr�test_isMultilineZs


zLineTests.test_isMultilinecCs4d}t�|�}|�|�d}t�|�}|�|�dS)zX
        L{text.endsInNewline} returns C{True} if the string ends in a newline.
        znewline
ZoldlineN)rZ
endsInNewlinerr$r%rrr�test_endsInNewlinegs


zLineTests.test_endsInNewlineN)rr r!r"r(r)rrrrr#Vs
r#c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�StringyStringTestsz*
    Tests for L{text.stringyString}.
    cCsd}t�|�}|�|d�dS)zA
        Tuple elements are displayed on separate lines.
        )�a�bz	(a,
 b,)
N�rZ
stringyStringrr%rrr�
test_tupleys
zStringyStringTests.test_tuplecCs"ddi}t�|�}|�|d�dS)z>
        Dicts elements are displayed using C{str()}.
        r+rz{a: 0}Nr-r%rrr�	test_dict�s
zStringyStringTests.test_dictcCs"ddg}t�|�}|�|d�dS)zO
        List elements are displayed on separate lines using C{str()}.
        r+r,z	[a,
 b,]
Nr-r%rrr�	test_list�s
zStringyStringTests.test_listN)rr r!r"r.r/r0rrrrr*us		r*c@s eZdZdZdd�Zdd�ZdS)�
SplitTestsz(
    Tests for L{text.splitQuoted}.
    cCs$d}t�|�}|�dddg|�dS)z:
        Splitting strings with one-word phrases.
        zThis code "works."ZThis�codezworks.N�rZsplitQuotedr�rr&�rrrr�test_oneWord�s
zSplitTests.test_oneWordcCs&d}t�|�}|�ddddg|�dS)NzThe "hairy monkey" likes pie.ZThezhairy monkeyZlikeszpie.r3r4rrr�test_multiWord�s
zSplitTests.test_multiWordN)rr r!r"r6r7rrrrr1�s	r1c@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)S)*�StrFileTestscCstd�|_dS�Nzthis is a test string)�StringIO�ior
rrrr�szStrFileTests.setUpcCsdS)Nrr
rrr�tearDown�szStrFileTests.tearDowncCs|�t�d|j��dS)N�x�r$r�strFiler;r
rrr�test_1_f�szStrFileTests.test_1_fcCs|�t�d|j��dS)N�t�rrr?r;r
rrr�test_1_1�szStrFileTests.test_1_1cCs|�t�d|j��dS)N�hrBr
rrr�test_1_2�szStrFileTests.test_1_2cCs|�t�d|j��dS)N�irBr
rrr�test_1_3�szStrFileTests.test_1_3cCs|�t�d|j��dS)Nr&rBr
rrr�test_1_4�szStrFileTests.test_1_4cCs|�t�d|j��dS)N�nrBr
rrr�test_1_5�szStrFileTests.test_1_5cCs|�t�d|j��dS)N�grBr
rrr�test_1_6�szStrFileTests.test_1_6cCs|�t�d|j��dS)NZthirBr
rrr�test_3_1�szStrFileTests.test_3_1cCs|�t�d|j��dS)NZhisrBr
rrr�test_3_2�szStrFileTests.test_3_2cCs|�t�d|j��dS)Nzis rBr
rrr�test_3_3�szStrFileTests.test_3_3cCs|�t�d|j��dS)NZingrBr
rrr�test_3_4�szStrFileTests.test_3_4cCs|�t�d|j��dS)NZblar>r
rrr�test_3_f�szStrFileTests.test_3_fcCs|�t�d|j��dS)Nzthis is a testrBr
rrr�test_large_1�szStrFileTests.test_large_1cCs|�t�d|j��dS)Nzis a test stringrBr
rrr�test_large_2�szStrFileTests.test_large_2cCs|�t�d|j��dS)Nzds jhfsa k fdasr>r
rrr�test_large_f�szStrFileTests.test_large_fcCs|�t�d|j��dS)Nz-djhsakj dhsa fkhsa s,mdbnfsauiw bndasdf hreewr>r
rrr�test_overlarge_f�s�zStrFileTests.test_overlarge_fcCs|�t�d|j��dSr9rBr
rrr�	test_self�szStrFileTests.test_selfcCs|�t�d|jd��dS)NzThIs is A test STRINGFrBr
rrr�test_insensitive�szStrFileTests.test_insensitiveN)rr r!rr<r@rCrErGrHrJrLrMrNrOrPrQrRrSrTrUrVrWrrrrr8�s(r8N)r"Ztwisted.python.compatrr:Z
twisted.trialrZtwisted.pythonrrZTestCaserr#r*r1r8rrrr�<module>s�< !