HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.7/test/__pycache__/test_textwrap.cpython-37.opt-1.pyc
B

��gZ��@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�e��dS)�N)�TextWrapper�wrap�fill�dedent�indent�shortenc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�BaseTestCasez5Parent class with utility methods for textwrap tests.cCsht|t�rNg}x*tt|��D]}|�d|||f�qW|rHd�|�nd}nt|t�rddt|�}|S)Nz  %d: %r�
z
  no linesz  %s
)�
isinstance�list�range�len�append�join�str�repr)�selfZtextin�result�i�r�./usr/local/lib/python3.7/test/test_textwrap.py�shows

zBaseTestCase.showc	Cs&|�||d|�|�|�|�f�dS)Nzexpected:
%s
but got:
%s)�assertEqualr)rr�expectrrr�checkszBaseTestCase.checkcKst||f|�}|�||�dS)N)rr)r�text�widthr�kwargsrrrr�
check_wrap#szBaseTestCase.check_wrapcCs&|j�|�}|�||d||f�dS)Nz
expected %r
but got  %r)�wrapper�_splitr)rrrrrrr�check_split'szBaseTestCase.check_splitN)�__name__�
__module__�__qualname__�__doc__rrrr!rrrrrs
rc@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}|�|dddddddg�|�|d	d
dg�|�|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$|�ddg�|jddgdd�dS)N��F)�drop_whitespace)r)rrrr�test_empty_stringDszWrapTestCase.test_empty_stringcCs*|jddgdd�|jddgddd�dS)Nr-r.z++)�initial_indentF)r1r/)r)rrrr�%test_empty_string_with_initial_indentIsz2WrapTestCase.test_empty_string_with_initial_indentcCs�d}dddddg}tddd	�}|�|�}|�||�|�|�}|�|d
�|��d}dg}|�|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}|�|�|�|�d}dg}|�|�|�|�d}|�|�|�|�d	}d
g}|�|�|�|�d|_dd
dg}|�|�|�|�d}dddg}|�|�|�|�d|_dg}|�|�|�|�d}dg}|�|�|�|�dS)N�<T)r3z$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}|�|dddg�|�|ddg�dS)NzThis is a
short paragraph.r8zThis is a shortz
paragraph.�(zThis is a short paragraph.)r)rrrrr�test_wrap_short�s
zWrapTestCase.test_wrap_shortcCs,d}|�|ddg�|j|ddgdd�dS)NzThis is a short line.�z(1) This is a short line.z(1) )r1)r)rrrrr�test_wrap_short_1line�sz"WrapTestCase.test_wrap_short_1linecCs�d}|�|dddg�|�|dddg�|�|dddg�d	�d
�}|j|d|dd
�|�||�|�ddg�|�ddg�|�dd�d
��dS)NzBthis-is-a-useful-feature-for-reformatting-posts-from-tim-peters'lyr:zthis-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}|�|ddddg�|�|dddg�|j|d	|��d
d�d}|�|d
ddg�|�|dddg�|�|ddg�|j|d	|��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.r:z(Python 1.0.0 was released on 1994-01-26.z(Python 1.0.1 was released on 1994-02-15.r@F)rAzI do all my shopping at 7-11.�zI do all my shopping atz7-11.��)rrB)rrrrr�test_hyphenated_numbers�s



z$WrapTestCase.test_hyphenated_numberscCsZd}|�|dddg�|�|dddg�dd	g}|�|d
|�|�|d|�|�|ddg�d
}dddg}|�|d|�|�|d|�dddg}|�|d|�|�|d|�ddg}|�|d|�|�|d|�ddg}|�|d|�|�|d|�d}ddddd dd!d"dd#d d$dd%d&d#dd'g}|�||�d(}d#dd)d d*d d+dd,dd-g}|�||�dS).Nz$Em-dashes should be written -- thus.rDzEm-dashes should bezwritten -- thus.rFzEm-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}|�|dddddg�|�|ddd	d
g�ddg}|�|d
|�|�|d|�|�|d|�|�|d|�ddg}|�|d|�|�|d|�dd
g}|�|d|�d}ddddddddddddddg}|�||�dS) Nz<You should use the -n option, or --dry-run in its long form.r8zYou 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.rO�"rH�&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�therPz-nzoption,�orz--dry-�runz--dryrun)rr!)rrrrrr�test_unix_optionss6zWrapTestCase.test_unix_optionsc	Cs�|�ddddddg�|�ddddg�|�d	ddd
g�|�ddg�|�ddg�|�d
ddg�|�dddddddg�dS)Nzwhat the--hey!ZwhatrPrXz--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_hyphensc	Csv|�dddddddg�|�ddddd	ddg�|�d
ddddddg�|�d
ddddddg�|�dd�d��dS)Nzthe 'wibble-wobble' widgetrXrPz'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!rB)rrrr�test_punct_hyphensDszWrapTestCase.test_punct_hyphensc
CsJ|�ddddddg�|�ddddddg�|�d	d
dddddd
g�dS)Nzfoo (--option) barr]rPz
(--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/r1)r)rrrr�6test_drop_whitespace_false_whitespace_only_with_indentsszCWrapTestCase.test_drop_whitespace_false_whitespace_only_with_indentcCs|�ddg�dS)Nz  r.)r)rrrr�$test_drop_whitespace_whitespace_onlyysz1WrapTestCase.test_drop_whitespace_whitespace_onlycCs*d}|�|ddg�|�|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�|�|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++)r1)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  )r1�subsequent_indent)r)rrrr�&test_drop_whitespace_whitespace_indent�sz3WrapTestCase.test_drop_whitespace_whitespace_indentcCsDd}|j�|�}|�|dddddddddddd	dd
ddddg�dS)
Nz0Hello there -- you goof-ball, use the -b option!�HellorPZtherez--Zyouzgoof-zball,ZuserXz-bzoption!)rr r)rrrrrr�
test_split�s
zWrapTestCase.test_splitcCs4d}|j|dddgdd�|j|dddgd	d�dS)
Nz
yaba daba-doorbz
yaba daba-ZdooT)�break_on_hyphensZyabazdaba-dooF)r)rrrrr�test_break_on_hyphens�s
z"WrapTestCase.test_break_on_hyphenscCs(d}|�tt|d�|�tt|d�dS)NzWhatever, it doesn't matter.r���)�assertRaises�
ValueErrorr)rrrrr�test_bad_width�szWrapTestCase.test_bad_widthcCsd}|�|ddddg�dS)NuDie Empfänger-Auswahl�
ZDieuEmpfänger-ZAuswahl)r)rrrrr�test_no_split_at_umlaut�sz$WrapTestCase.test_no_split_at_umlautcCsd}|�|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.r8zThis is a sentencez	with non-ubreaking space.T)ro�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.r8zThis is a sentencez	with non-ubreaking space.T)roryunon-breaking space.F)r)rrrrr�test_narrow_non_breaking_space�sz+WrapTestCase.test_narrow_non_breaking_spaceN)!r"r#r$r(r,r0r2r6r9r;r=rCrGrSr[r_r`rarcrdrerfrhrirjrlrnrprtrvrxrzr{rrrrr&.s< *

7"
		r&c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�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 [...]�ruz
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|jdddddd
ddgdd�dS)Nr)zHello there,zhow are youz	this finez
day? [...]r4)r}r.rmz[...]r~z
          z	day?  I'mzglad to hearzit!)rr)rrrr�test_spaces�s$

zMaxLinesTestCase.test_spacesc	Cs�|j|jddgddd�|j|jdddgddd�|�t��t|jd	d
ddd�WdQRX|�t��t|jd	d
ddd
�WdQRX|j|jd	ddgdd
ddd�|j|jd	dgddd
dd�|j|jd|jgdd�dS)Nr)zHello...r@z...)r}�placeholderzHello there,z
how are...r~rKz    z [truncated]...)r1r}r�)rkr}r�z    Hello there,z  [truncated]...z  )r}r1rkr�r+a�........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................)r�)rrrrrsr)rrrr�test_placeholders:





z!MaxLinesTestCase.test_placeholdercCs d}|j|dddgddd�dS)Nz1Good grief Python features are advancing quickly!r)z
Good griefzPython*****�z*****)r}r�)r)rrrrr�test_placeholder_backtrack2s
z+MaxLinesTestCase.test_placeholder_backtrackN)r"r#r$rr,rr�r�rrrrr|�s
 r|c@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(?szLongWordTestCase.setUpc
Csp|�|jdddddg�|�|jdddg�|jd	d
ddd
dddgdd�|�|jddddddddddg	�dS)Nr<zDid you say "supercalifragiliszticexpialidocious?" How *do*zyou spell that odd word,zanyways?rgz1Did you say "supercalifragilisticexpialidocious?"z*How *do* you spell that odd word, anyways?z----------hellorbz
----------z               hz               ez               lz               oz               )rkr)zDid you say z"supercalifr�agilisticexpzialidocious?z
" How *do*z	you spellzthat oddzword,)rr)rrrr�test_break_longFs4


z LongWordTestCase.test_break_longcCsVd|j_d|j_ddddg}|j�|j�}|�||�t|jddd�}|�||�dS)Nrr<zDid you sayz%"supercalifragilisticexpialidocious?"zHow *do* you spell that oddzword, anyways?)rrA)rrArrrr)rrrrrr�test_nobreak_longjsz"LongWordTestCase.test_nobreak_longcCs |j|jdddddgdd�dS)Nr)zDid you say z"supercalifrr�z[...]r4)r})rr)rrrr�test_max_lines_longzs
z$LongWordTestCase.test_max_lines_longN)r"r#r$r(r�r�r�rrrrr�>s$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�}|�||�dS)NznThis paragraph will be filled, first
without any indentation, and then with
some (including a hanging indent).r:)rrr)rrrrrr�	test_fill�szIndentTestCases.test_fillcCsPdddg}t|jddd�}|�||�d�|�}t|jddd�}|�||�dS)Nz#     This paragraph will be filled,z'first without any indentation, and thenz'with some (including a hanging indent).r:z     )r1r	)rrrrr)rrrrrr�test_initial_indent�s
z#IndentTestCases.test_initial_indentcCs&d}t|jdddd�}|�||�dS)Nz~  * This paragraph will be filled, first
    without any indentation, and then
    with some (including a hanging
    indent).r:z  * z    )r1rk)rrr)rrrrrr�test_subsequent_indent�s
z&IndentTestCases.test_subsequent_indentN)r"r#r$r(r�r�r�rrrrr��sr�c@sDeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)�DedentTestCasecCs|�|t|��dS)z,assert that dedent() has no effect on 'text'N)rr)rrrrr�assertUnchanged�szDedentTestCase.assertUnchangedcCs<d}|�|�d}|�|�d}|�|�d}|�|�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}|�|t|��d}d}|�|t|��d}d}|�|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}|�|t|��d}d}|�|t|��d}d}|�|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_unevencCsLd}d}|�|t|��d}d}|�|t|��d}d}|�|t|��dS)Nz     Foo
    Bar
z	 Foo
Bar
z     Foo

    Bar
z
 Foo

Bar
z     Foo
    
    Bar
)rr)rrrrrr�test_dedent_declining�sz$DedentTestCase.test_dedent_decliningcCs,d}d}|�|t|��|�|t|��dS)Nz  hello	there
  how are	you?zhello	there
how are	you?)rr)rrrrrr�"test_dedent_preserve_internal_tabssz1DedentTestCase.test_dedent_preserve_internal_tabscCs�d}|�|�d}|�|�d}d}|�|t|��d}|�|t|��d}|�|t|��d}d}|�|t|��d	}d
}|�|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_tabss"

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

Testing.z
Hi.
This is a test.
Testing.
)z Hi.
This is a test.
Testing.
z#
Hi.
This is a test.

Testing.

cCs&x |jD]}|�t|d�|�qWdS)Nr-)�CASESrr)rrrrr�test_indent_nomargin_defaultDsz+IndentTestCase.test_indent_nomargin_defaultcCs(x"|jD]}|�t|dd�|�qWdS)Nr-)r�rr)rrrrr�%test_indent_nomargin_explicit_defaultIsz4IndentTestCase.test_indent_nomargin_explicit_defaultcCs0dd�}x"|jD]}|�t|d|�|�qWdS)NcSsdS)NTr)�linerrr�<lambda>R�z?IndentTestCase.test_indent_nomargin_all_lines.<locals>.<lambda>r-)r�rr)r�	predicaterrrr�test_indent_nomargin_all_linesOsz-IndentTestCase.test_indent_nomargin_all_linescCs0dd�}x"|jD]}|�t|d|�|�qWdS)NcSsdS)NFr)r�rrrr�Xr�z5IndentTestCase.test_indent_no_lines.<locals>.<lambda>z    )r�rr)rr�rrrr�test_indent_no_linesVsz#IndentTestCase.test_indent_no_linescCs*x$|jD]}|�tt|d��|�qWdS)Nz    )�ROUNDTRIP_CASESrrr)rrrrr�test_roundtrip_spaces\sz$IndentTestCase.test_roundtrip_spacescCs*x$|jD]}|�tt|d��|�qWdS)Nz		)r�rrr)rrrrr�test_roundtrip_tabsasz"IndentTestCase.test_roundtrip_tabscCs*x$|jD]}|�tt|d��|�qWdS)Nz 	  	 )r�rrr)rrrrr�test_roundtrip_mixedfsz#IndentTestCase.test_roundtrip_mixedcCs8d}d}x*t|j|�D]\}}|�t||�|�qWdS)Nz  )z"  Hi.
  This is a test.
  Testing.z#  Hi.
  This is a test.

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

  Testing.

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

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

  Testing.

)r�r�rr)rr�r�rrrrr�test_indent_explicit_default}s
z+IndentTestCase.test_indent_explicit_defaultcCsBd}d}dd�}x,t|j|�D]\}}|�t|||�|�qWdS)Nz  )z"  Hi.
  This is a test.
  Testing.z%  Hi.
  This is a test.
  
  Testing.z&  
  Hi.
  This is a test.
  Testing.
z&  Hi.
  This is a test.
  Testing.
z/  
  Hi.
  This is a test.
  
  Testing.
  
cSsdS)NTr)r�rrrr��r�z6IndentTestCase.test_indent_all_lines.<locals>.<lambda>)r�r�rr)rr�r�r�rrrrr�test_indent_all_lines�s

z$IndentTestCase.test_indent_all_linescCsBd}d}dd�}x,t|j|�D]\}}|�t|||�|�qWdS)Nz  )zHi.
This is a test.
Testing.zHi.
This is a test.
  
Testing.z   
Hi.
This is a test.
Testing.
z Hi.
This is a test.
Testing.
z)  
Hi.
This is a test.
  
Testing.
  
cSs
|��S)N)�strip)r�rrrr��r�z8IndentTestCase.test_indent_empty_lines.<locals>.<lambda>)r�r�rr)rr�r�r�rrrrr�test_indent_empty_lines�s

z&IndentTestCase.test_indent_empty_linesN)r"r#r$r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr�0sr�c@sDeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)�ShortenTestCasecKst||f|�}|�||�dS)N)rr)rrrrrrrrr�
check_shorten�szShortenTestCase.check_shortencCs>d}|�|dd�|�|t|�|�|�|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!rLzHello 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|�ddd�dS)Nr-r.)r�)rrrrr0�sz!ShortenTestCase.test_empty_stringcCsNd}|�|dd�|�|dd�|�ddd�|�dd	d
�|�ddd�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 [...]rbz[...])r�)rrrrrr6�szShortenTestCase.test_whitespacec	Cs6tdddd�|�t��tdddd�WdQRXdS)NZxxxxxxxxxxxxxxxxxxxx�z(......))rr�z	(.......))rrrrs)rrrr�$test_width_too_small_for_placeholder�sz4ShortenTestCase.test_width_too_small_for_placeholdercCs|�ddd�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�r0r6r�r�rrrrr��s
r��__main__)Zunittest�textwraprrrrrrZTestCaserr&r|r�r�r�r�r�r"�mainrrrr�<module>s 4_E3z9