Sindbad~EG File Manager

Current Path : /proc/2568807/root/usr/local/lib/python3.12/test/__pycache__/
Upload File :
Current File : //proc/2568807/root/usr/local/lib/python3.12/test/__pycache__/test_textwrap.cpython-312.opt-1.pyc

�

'Μg����\�ddlZddlmZmZmZmZmZmZGd�dej�Z	Gd�de	�Z
Gd�de	�ZGd	�d
e	�ZGd�de	�Z
Gd
�de	�ZGd�dej�ZGd�dej�ZGd�de	�Zedk(rej&�yy)�N)�TextWrapper�wrap�fill�dedent�indent�shortenc�(�eZdZdZd�Zd�Zd�Zd�Zy)�BaseTestCasez5Parent class with utility methods for textwrap tests.c��t|t�rMg}tt|��D]}|j	d|||fz��|rdj|�}|Sd}|St|t�rdt|�z}S)Nz  %d: %r�
z
  no linesz  %s
)�
isinstance�list�range�len�append�join�str�repr)�self�textin�result�is    �//usr/local/lib/python3.12/test/test_textwrap.py�showzBaseTestCase.shows����f�d�#��F��3�v�;�'���
�
�j�A�v�a�y�>�9�:�(�*0�T�Y�Y�v�&�F��
�7C�F��
����
$���V��,�F��
�c
�r�|j||d|j|��d|j|����y)Nz
expected:
z

but got:
)�assertEqualr)rr�expects   r�checkzBaseTestCase.checks0��������	�	�&�!�4�9�9�V�#4�
6�	7rc�B�t||fi|��}|j||�y�N)rr�r�text�widthr�kwargsrs      r�
check_wrapzBaseTestCase.check_wrap#s!���d�E�,�V�,���
�
�6�6�"rc�l�|jj|�}|j||d|�d|���y)Nz

expected z

but got  )�wrapper�_splitr)rr#rrs    r�check_splitzBaseTestCase.check_split's2�����$�$�T�*�������*0�&�:�	;rN)�__name__�
__module__�__qualname__�__doc__rrr&r*�rrr
r
s��?��7�
#�;rr
c��eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z y) �WrapTestCasec�&�td��|_y)N�-)r$)rr(�rs r�setUpzWrapTestCase.setUp0s��"��,��rc��d}|j|dgd��|j|dddg�|j|d|g�y)N�=Hello there, how are you this fine day?  I'm glad to hear it!���Hello there,�how are you�	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&�rr#s  r�test_simplezWrapTestCase.test_simple3sP��O������b� �	!�	
����b�B�/�1�	2�	
����b�4�&�)rc�T�|jddg�|jddgd��y)N��F��drop_whitespacer?r4s r�test_empty_stringzWrapTestCase.test_empty_stringDs&������A�r�"�����A�r�5��9rc�Z�|jddgd��|jddgdd��y)NrCrD�++��initial_indentF)rKrFr?r4s r�%test_empty_string_with_initial_indentz2WrapTestCase.test_empty_string_with_initial_indentIs,������A�r�$��7�����A�r�$���Nrc�8�d}gd�}tdd��}|j|�}|j||�|j|�}|j|dj	|��d}dg}|j|d	|�d
}dg}|j|d	|d�
�y)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!r3T��fix_sentence_endingsrz	Test	default		tabsize.z(        Test    default         tabsize.r>z	Test	custom		tabsize.z     Test    custom      tabsize.�)�tabsize)rrrrrr&)rr#rr(rs     r�test_whitespacezWrapTestCase.test_whitespaceNs��������b�t�<�����d�#���
�
�6�6�"����d�#���
�
�6�4�9�9�V�,�-�,��<�=������b�&�)�+��4�5������b�&�!��4rc��tdd��}d}dg}|j|j|�|�d}dg}|j|j|�|�d}|j|j|�|�d	}d
g}|j|j|�|�d|_gd�}|j|j|�|�d
}gd�}|j|j|�|�d|_dg}|j|j|�|�d}dg}|j|j|�|�y)N�<TrNz$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$)rr(r#rs    r�test_fix_sentence_endingsz&WrapTestCase.test_fix_sentence_endingsns,���b�t�<��
6��9�:���
�
�7�<�<��%�v�.�
2��5�6���
�
�7�<�<��%�v�.�2���
�
�7�<�<��%�v�.�;��?�@���
�
�7�<�<��%�v�.���
�D���
�
�7�<�<��%�v�.�C��#��	
�
�
�7�<�<��%�v�.���
�F�G���
�
�7�<�<��%�v�.�&��)�*���
�
�7�<�<��%�v�.rc�Z�d}|j|dddg�|j|ddg�y)NzThis is a
short paragraph.rUzThis is a shortz
paragraph.�(zThis is a short paragraph.r?r@s  r�test_wrap_shortzWrapTestCase.test_wrap_short�s8��-������b�#4�#/�#1�	2�����b�#?�"@�Arc�\�d}|j|ddg�|j|ddgd��y)NzThis is a short line.�z(1) This is a short line.z(1) rJr?r@s  r�test_wrap_short_1linez"WrapTestCase.test_wrap_short_1line�s;��'������b�#:�";�<�����b�#>�"?�'-�	�	/rc��d}|j|dddg�|j|dddg�|j|dddg�d	jd
�}|j|d|d�
�|j||�|jddg�|jddg�|jddjd
��y)NzBthis-is-a-useful-feature-for-reformatting-posts-from-tim-peters'lyrXzthis-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*�rr#rs   r�test_hyphenatedzWrapTestCase.test_hyphenated�s���8��	
����b�8�@�B�	C�	
����b�8�@�B�	C�	
����b�E�3�5�	6�>�?D�u�S�z�	�����a��%��@�����v�&�����H�:�.�����Y�K�0�����)9�)?�)?��)D�Erc�h�d}|j|dgd��|j|dddg�|j|d|j�d�	�d
}|j|ddd
g�|j|ddd
g�|j|dd
g�|j|d|j�d�	�y)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.rXz(Python 1.0.0 was released on 1994-01-26.z(Python 1.0.1 was released on 1994-02-15.r`FrazI do all my shopping at 7-11.�zI do all my shopping atz7-11.��)r&rcr@s  r�test_hyphenated_numbersz$WrapTestCase.test_hyphenated_numbers�s���*��	
����b�#>�	?�	
����b�#M�#M�#O�	P�����a�������F�.������b�#<�#*�#,�	-�����b�#<�#*�#,�	-�����b�#B�"C�D�����a�������Frc��d}|j|dddg�|j|dddg�dd	g}|j|d
|�|j|d|�|j|ddg�d
}gd�}|j|d|�|j|d|�gd�}|j|d|�|j|d|�ddg}|j|d|�|j|d|�ddg}|j|d|�|j|d|�d}gd�}|j||�d}gd�}|j||�y)Nz$Em-dashes should be written -- thus.rgzEm-dashes should bezwritten -- thus.rizEm-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 even�---this.��)zYou can also do--zthis or even---�this.��zYou can also do--this or evenrn�z You can also do--this or even---rq� z7Here's an -- em-dash and--here's another---and another!)zHere's� �anrv�--rvzem-�dashrv�andrxzhere'srv�anotherz---rzrvzanother!zand then--bam!--he was gone)rzrv�thenrxzbam!rx�herv�wasrv�gone�r&r*rds   r�test_em_dashzWrapTestCase.test_em_dash�su��5������b�.�+�-�	.�	
����b�6�#�%�	&�3��������b�&�)�����b�&�)�����b�?�@�	B�
7����	
����b�&�)�����b�&�)���	
����b�&�)�����b�&�)�1��������b�&�)�����b�&�)�4��������b�&�)�����b�&�)�I��*��	
����v�&�,��1������v�&rc��d}|j|dgd��|j|dgd��ddg}|j|d|�|j|d	|�|j|d
|�|j|d|�dd
g}|j|d|�|j|d|�ddg}|j|d|�d}gd�}|j||�y)Nz<You should use the -n option, or --dry-run in its long form.rU)zYou should use thez-n option, or --dry-zrun in its longzform.�)zYou should use the -nzoption, or --dry-run�in its long form.z You should use the -n option, orz--dry-run in its long form.ru�"rl�&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�r=z'the -n option, or --dry-run or --dryrun)�thervz-nrvzoption,rv�orrvz--dry-�runrvr�rvz--dryrunr�rds   r�test_unix_optionszWrapTestCase.test_unix_optionss���N������b�"�	#�
	
����b�.�	/�5�/�1������b�&�)�����b�&�)�����b�&�)�����b�&�)�;�)�+������b�&�)�����b�&�)�>�%�'������b�&�)�9��?������v�&rc��|jdgd��|jdgd��|jdgd��|jddg�|jddg�|jd	d
dg�|jdgd
��y)Nzwhat the--hey!)�whatrvr�rxzhey!z
what the--)r�rvzthe--zwhat the--.)r�rvzthe--.z	--text--.z--optionz--option-opt�	--option-�optzfoo --option-opt bar)�foorvr�r�rv�bar�r*r4s r�test_funky_hyphenszWrapTestCase.test_funky_hyphens3s���	
���)�+M�N�����'=�>�����(?�@�����{�m�4�	
����j�\�2�����+�u�)=�>����/�E�	Grc���|jdgd��|jdgd��|jdgd��|jdgd��|jd	d
jd��y)Nzthe 'wibble-wobble' widget)r�rvz'wibble-zwobble'rv�widgetzthe "wibble-wobble" widget)r�rvz"wibble-zwobble"rvr�zthe (wibble-wobble) widget)r�rvz(wibble-zwobble)rvr�zthe ['wibble-wobble'] widget)r�rvz	['wibble-zwobble']rvr�zwhat-d'you-call-it.zwhat-d'you-|call-|it.r_)r*rcr4s r�test_punct_hyphenszWrapTestCase.test_punct_hyphensDsy��	
���5�K�	M����5�K�	M����5�K�	M����7�M�	O�	
���.�0�6�6�s�;�	=rc�|�|jdgd��|jdgd��|jdgd��y)Nzfoo (--option) bar)r�rvz
(--option)rvr�z
foo (bar) baz)r�rvz(bar)rv�bazzblah (ding dong), wubba)�blahrvz(dingrvzdong),rv�wubbar�r4s r�test_funky_parenszWrapTestCase.test_funky_parensYsD��	
���-�?�	A�	
����:�	<����2�(�	)rc�6�d}|j|dgd�d��y)Nz0 This is a    sentence with     much whitespace.�
)z
 This is a�    z	sentence z	with     z
much whitezspace.FrEr?r@s  r�test_drop_whitespace_falsez'WrapTestCase.test_drop_whitespace_falsefs'��B������b�>�(-�	�	/rc�0�|jdddgd��y)N�   rDFrEr?r4s r�*test_drop_whitespace_false_whitespace_onlyz7WrapTestCase.test_drop_whitespace_false_whitespace_onlyos������q�5�'�5��Arc�2�|jdddgdd��y)Nr�rD�     F�  )rFrKr?r4s r�6test_drop_whitespace_false_whitespace_only_with_indentzCWrapTestCase.test_drop_whitespace_false_whitespace_only_with_indentss"��	
����q�7�)�U�'+�	�	-rc�*�|jddg�y)Nr�rDr?r4s r�$test_drop_whitespace_whitespace_onlyz1WrapTestCase.test_drop_whitespace_whitespace_onlyys������a��$rc�Z�d}|j|ddg�|j|dddg�y)Nz, This is a sentence with leading whitespace.�2r[z This is a sentence withzleading whitespace.r?r@s  r�'test_drop_whitespace_leading_whitespacez4WrapTestCase.test_drop_whitespace_leading_whitespace}s:��
>������b�G�H�	J�����b�3�5J�K�	Mrc�`�d}|j|dgd�d��|j|dddg�y)Nzabcd    efghrD)�abcdr��efghFrEr�r�r?r@s  r�$test_drop_whitespace_whitespace_linez1WrapTestCase.test_drop_whitespace_whitespace_line�s9��������a�!9�(-�	�	/�����a�&�&�!1�2rc�.�|jddgd��y)Nr�rDrIrJr?r4s r�0test_drop_whitespace_whitespace_only_with_indentz=WrapTestCase.test_drop_whitespace_whitespace_only_with_indent�s��	
����a��D��9rc�4�|jddddgdd��y)Nz	abcd efghrDz  abcdz  efghr��rK�subsequent_indentr?r4s r�&test_drop_whitespace_whitespace_indentz3WrapTestCase.test_drop_whitespace_whitespace_indent�s&��	
����Q��8�(<�'+�t�	�	Erc�f�d}|jj|�}|j|gd��y)Nz0Hello there -- you goof-ball, use the -b option!)�Hellorv�therervrxrv�yourvzgoof-zball,rv�uservr�rvz-brvzoption!)r(r)r)rr#rs   r�
test_splitzWrapTestCase.test_split�s3��B�����$�$�T�*���
�
�6�K�	Lrc�d�d}|j|dddgd��|j|dddgd	��y)
Nz
yaba daba-door�z
yaba daba-�dooT��break_on_hyphens�yabazdaba-dooFr?r@s  r�test_break_on_hyphensz"WrapTestCase.test_break_on_hyphens�sE��������b�<��"7�)-�	�	/�����b�6�:�"6�).�	�	0rc�x�d}|jtt|d�|jtt|d�y)NzWhatever, it doesn't matter.r���)�assertRaises�
ValueErrorrr@s  r�test_bad_widthzWrapTestCase.test_bad_width�s/��-�����*�d�D�!�4����*�d�D�"�5rc�2�d}|j|dgd��y)NuDie Empfänger-Auswahl�
)�DieuEmpfänger-�Auswahlr?r@s  r�test_no_split_at_umlautz$WrapTestCase.test_no_split_at_umlaut�s��)������b�"E�Frc�2�d}|j|dddg�y)Nuaa ää-ää�uaa ää-uäär?r@s  r�test_umlaut_followed_by_dashz)WrapTestCase.test_umlaut_followed_by_dash�s��%������a�.�*�!=�>rc�d�d}|j|dgd�d��|j|dgd�d��y)Nu,This is a sentence with non-breaking space.rU)�This is a sentence�	with non-ubreaking space.Tr�)r��withunon-breaking space.Fr?r@s  r�test_non_breaking_spacez$WrapTestCase.test_non_breaking_space�sH��M������b�=�*.�		�	/�	
����b�A�*/�		�	0rc�d�d}|j|dgd�d��|j|dgd�d��y)Nu-This is a sentence with non-breaking space.rU)r�r�ubreaking space.Tr�)r�r�unon-breaking space.Fr?r@s  r�test_narrow_non_breaking_spacez+WrapTestCase.test_narrow_non_breaking_space�sM��2��	
����b�D�*.�		�	/�	
����b�H�*/�		�	0rN)!r+r,r-r5rArGrLrRrVrYr\rerjr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r/rrr1r1.s���-�*�":�
O�
5�@(/�TB�/�F�4G�(4'�n '�DG�"=�*)�/�B�-�%�	M�3�:�E�	L�0�6�G�?�
0�0rr1c�(�eZdZdZd�Zd�Zd�Zd�Zy)�MaxLinesTestCaser7c��|j|jddgd��|j|jddgd��|j|jdddgd��|j|jd	dd
gd��|j|jd|jgd��|j|jdgd�d
��y)Nr8zHello [...]r��	max_linesr`r:z	how [...]�r�z
how are [...]r>r9rD�r&r#r4s rrAzMaxLinesTestCase.test_simple�s�������	�	�2�&��"#�	�	%�	
����	�	�2�&��"#�	�	%�	
����	�	�2�'�$�&�"#�	�	%�	
����	�	�2�'�(�*�"#�	�	%�	
����	�	�2��	�	�{�a��@�����	�	�2� �#$�	�	%rc���|j|jdgd�d��|j|jdddgd��|j|jd	zdgd
�d��y)Nr8)r:r;r<z
day? [...]rPr�rDr��[...]r�z
          r9r�r4s r�test_spaceszMaxLinesTestCase.test_spaces�sx������	�	�2�'�#$�	�	%�	
����	�	�1� � �"�"#�	�	%�
	
����	�	�H�,�b� �#$�	�	%rc	�|�|j|jddgdd��|j|jdddgdd��|jt�5t	|jd	d
dd��ddd�|jt�5t	|jd	d
dd�
�ddd�|j|jd	ddgdd
dd��|j|jd	dgddd
d��|j|jd|jgd��y#1swY��xYw#1swY��xYw)Nr8zHello...r`z...�r��placeholderr:z
how are...r�rpr�z [truncated]...)rKr�r�)r�r�r�z    Hello there,z  [truncated]...r�)r�rKr�r�r>a�........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................�r�)r&r#r�r�rr4s r�test_placeholderz!MaxLinesTestCase.test_placeholders=������	�	�2�#��"#�$)�	�	+�	
����	�	�2�'�%�'�"#�$)�		�	+��
�
�z�
*�����B�v��*;�
=�+��
�
�z�
*�����B�&��*;�
=�+�	
����	�	�2�+�+�-�"#�'-�*.�$5�
	�	7�	
����	�	�2�+�,�"#�'+�*0�$5�	�	7�	
����	�	�2��	�	�{�
��K�'+�
*��+�
*�s�D&�D2�&D/�2D;c�8�d}|j|dddgdd��y)Nz1Good grief Python features are advancing quickly!r8z
Good griefzPython*****�z*****r�r?r@s  r�test_placeholder_backtrackz+MaxLinesTestCase.test_placeholder_backtrack2s-��
C������b�%�}�5�"#�$+�	�	-rN)r+r,r-r#rAr�r�r�r/rrr�r��s��J�D�%�2%�.L�@	-rr�c�$�eZdZd�Zd�Zd�Zd�Zy)�LongWordTestCasec�0�t�|_d|_y)Nz]Did you say "supercalifragilisticexpialidocious?"
How *do* you spell that odd word, anyways?
)rr(r#r4s rr5zLongWordTestCase.setUp?s��"�}�����	rc���|j|jdgd��|j|jdddg�|jddgd�d	�
�|j|jdgd��y)
Nr[)zDid you say "supercalifragiliszticexpialidocious?" How *do*zyou spell that odd word,�anyways?r�z1Did you say "supercalifragilisticexpialidocious?"z*How *do* you spell that odd word, anyways?z----------hellor�)z
----------z               hz               e�               lr�z               oz               )r�r8)	�Did you say �"supercalifr�agilisticexpzialidocious?z
" How *do*z	you spellzthat oddzword,r�r�r4s r�test_break_longz LongWordTestCase.test_break_longFs|��	
����	�	�2�%�	&�
	
����	�	�2�L�E�G�	H�	
�����-�-3�	�	4�	
����	�	�2�%�		&rc��d|j_d|j_gd�}|jj|j�}|j||�t|jdd��}|j||�y)Nrr[)zDid you sayz%"supercalifragilisticexpialidocious?"zHow *do* you spell that oddzword, anyways?)r$rb)r(rbr$rr#r�rrrs   r�test_nobreak_longz"LongWordTestCase.test_nobreak_longjsk��()����%��������
���"�"�4�9�9�-���
�
�6�6�"��d�i�i�r�A�>���
�
�6�6�"rc�F�|j|jdgd�d��y)Nr8)r�r�r�r�rPr�r�r4s r�test_max_lines_longz$LongWordTestCase.test_max_lines_longzs%������	�	�2�"�#$�	�	%rN)r+r,r-r5r�r�r�r/rrr�r�>s���"&�H#� %rr�c�*�eZdZd�Zd�Zd�Zd�Zd�Zy)�LongWordWithHyphensTestCasec�>�t�|_d|_d|_y)NzOWe used enyzme 2-succinyl-6-hydroxy-2,4-cyclohexadiene-1-carboxylate synthase.
zC1234567890-1234567890--this_is_a_very_long_option_indeed-good-bye"
)rr(�text1�text2r4s rr5z!LongWordWithHyphensTestCase.setUp�s��"�}�����
���
rc���ddg}|j|jd|�gd�}|j|jd|�gd�}|j|jd|�y)Nz(We used enyzme 2-succinyl-6-hydroxy-2,4-z&cyclohexadiene-1-carboxylate synthase.r�)
�We usedz	enyzme 2-z	succinyl-z
6-hydroxy-z2,4-�
cyclohexadziene-1-�
carboxylat�e�	synthase.r���
1234567890z
-123456789z
0--this_is�
_a_very_lo�
ng_option_zindeed-z	good-bye"�r&r�r��r�expecteds  r�test_break_long_words_on_hyphenz;LongWordWithHyphensTestCase.test_break_long_words_on_hyphen�sZ��>�<�>������
�
�B��1�M������
�
�B��1�:������
�
�B��1rc���ddg}|j|jd|d��gd�}|j|jd|d��gd�}|j|jd|�y)	Nz2We used enyzme 2-succinyl-6-hydroxy-2,4-cyclohexadziene-1-carboxylate synthase.r�Fr�)r�z
enyzme 2-sz
uccinyl-6-z
hydroxy-2,z
4-cyclohexz
adiene-1-c�
arboxylaterr�rrrs  r�#test_break_long_words_not_on_hyphenz?LongWordWithHyphensTestCase.test_break_long_words_not_on_hyphen�sb��H�2�4������
�
�B��5��I�K������
�
�B��5��I�:������
�
�B��1rc���gd�}|j|jd|d��gd�}|j|jd|d��gd�}|j|jd|�y)N�zWe used enyzme�52-succinyl-6-hydroxy-2,4-cyclohexadiene-1-carboxylaterr�Fra�r��enyzmerrr�rrrs  r�'test_break_on_hyphen_but_not_long_wordszCLongWordWithHyphensTestCase.test_break_on_hyphen_but_not_long_words�s_��!��	
����
�
�B��5��I�!��	
����
�
�B��5��I�:������
�
�B��1rc���gd�}|j|jd|dd��gd�}|j|jd|dd��gd�}|j|jd|�y)Nrr�F)rbr�rr�rrrs  r�*test_do_not_break_long_words_or_on_hyphenszFLongWordWithHyphensTestCase.test_do_not_break_long_words_or_on_hyphens�sq��!��	
����
�
�B��).�).�	�	0�!��	
����
�
�B��).�).�	�	0�:������
�
�B��1rN)r+r,r-r5r	rrrr/rrr�r��s���2�2�2�"2rr�c�$�eZdZd�Zd�Zd�Zd�Zy)�IndentTestCasesc��d|_y)NznThis paragraph will be filled, first without any indentation,
and then with some (including a hanging indent).)r#r4s rr5zIndentTestCases.setUp�s��4��	rc�X�d}t|jd�}|j||�y)NznThis paragraph will be filled, first
without any indentation, and then with
some (including a hanging indent).rX�rr#rr�s   r�	test_fillzIndentTestCases.test_fill�s)��&��
�d�i�i��$���
�
�6�6�"rc���gd�}t|jdd��}|j||�dj|�}t	|jdd��}|j||�y)N)z#     This paragraph will be filled,z'first without any indentation, and thenz'with some (including a hanging indent).rXr�rJr)rr#rrrr�s   r�test_initial_indentz#IndentTestCases.test_initial_indent�sY��=���d�i�i��G�<���
�
�6�6�"����6�"���d�i�i��G�<���
�
�6�6�"rc�^�d}t|jddd��}|j||�y)Nz~  * This paragraph will be filled, first
    without any indentation, and then
    with some (including a hanging
    indent).rXz  * r�r�rr�s   r�test_subsequent_indentz&IndentTestCases.test_subsequent_indent�s1�����d�i�i��%+�v�G���
�
�6�6�"rN)r+r,r-r5rrrr/rrrr�s��4�	#�#�#rrc�6�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	y)	�DedentTestCasec�:�|j|t|��y)z,assert that dedent() has no effect on 'text'N�rrr@s  r�assertUnchangedzDedentTestCase.assertUnchangeds������v�d�|�,rc��d}|j|�d}|j|�d}|j|�d}|j|�y)Nz,Hello there.
How are you?
Oh good, I'm glad.zHello there.

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

  Boo!
)r#r@s  r�test_dedent_nomarginz#DedentTestCase.test_dedent_nomarginsT��?�����T�"�&�����T�"�3�����T�"�*�����T�"rc��d}d}|j|t|��d}d}|j|t|��d}d}|j|t|��y)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.
r"rds   r�test_dedent_evenzDedentTestCase.test_dedent_evensa��:��6���������.�?��:���������.�A��:���������.rc��d}d}|j|t|��d}d}|j|t|��d}d}|j|t|��y)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
r"rds   r�test_dedent_unevenz!DedentTestCase.test_dedent_uneven%sf����
��
	
�������.�,��'���������.�-��'���������.rc��d}d}|j|t|��d}d}|j|t|��d}d}|j|t|��y)Nz     Foo
    Bar
z	 Foo
Bar
z     Foo

    Bar
z
 Foo

Bar
z     Foo
    
    Bar
r"rds   r�test_dedent_decliningz$DedentTestCase.test_dedent_declining=s`��$�����������.�'�� ���������.�+�� ���������.rc�x�d}d}|j|t|��|j|t|��y)Nz  hello	there
  how are	you?zhello	there
how are	you?r"rds   r�"test_dedent_preserve_internal_tabsz1DedentTestCase.test_dedent_preserve_internal_tabsNs6��0��.���������.�	
�������0rc�~�d}|j|�d}|j|�d}d}|j|t|��d}|j|t|��d}|j|t|��d}d}|j|t|��d	}d
}|j|t|��y)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#rrrds   r� test_dedent_preserve_margin_tabsz/DedentTestCase.test_dedent_preserve_margin_tabsZs���.�����T�"�5�����T�"�/��,���������.�2���������.�6���������.�4��.���������.�I��G���������.rN)
r+r,r-r#r%r'r)r+r-r/r/rrr r �s%��-�#�"/� /�0/�"1�/rr c�\�eZdZdZedzZd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zy)�IndentTestCase)�Hi.
This is a test.
Testing.zHi.
This is a test.

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

Testing.

c�^�|jD]}|jt|d�|�� y�NrC��CASESrrr@s  r�test_indent_nomargin_defaultz+IndentTestCase.test_indent_nomargin_default�s'���J�J�D����V�D�"�-�t�4�rc�`�|jD]}|jt|dd�|��!yr5r6r@s  r�%test_indent_nomargin_explicit_defaultz4IndentTestCase.test_indent_nomargin_explicit_default�s+���J�J�D����V�D�"�d�3�T�:�rc�f�d�}|jD]}|jt|d|�|��!y)Nc��y�NTr/��lines r�<lambda>z?IndentTestCase.test_indent_nomargin_all_lines.<locals>.<lambda>����rrCr6�r�	predicater#s   r�test_indent_nomargin_all_linesz-IndentTestCase.test_indent_nomargin_all_lines�s0��&�	��J�J�D����V�D�"�i�8�$�?�rc�f�d�}|jD]}|jt|d|�|��!y)Nc��y)NFr/r>s rr@z5IndentTestCase.test_indent_no_lines.<locals>.<lambda>�s��rr�r6rBs   r�test_indent_no_linesz#IndentTestCase.test_indent_no_lines�s.��&�	��J�J�D����V�D�&�)�<�d�C�rc	�p�|jD]'}|jtt|d��|��)y)Nr���ROUNDTRIP_CASESrrrr@s  r�test_roundtrip_spacesz$IndentTestCase.test_roundtrip_spaces��.���(�(�D����V�F�4��$8�9�4�@�)rc	�p�|jD]'}|jtt|d��|��)y)Nz		rIr@s  r�test_roundtrip_tabsz"IndentTestCase.test_roundtrip_tabs�rLrc	�p�|jD]'}|jtt|d��|��)y)Nz 	  	 rIr@s  r�test_roundtrip_mixedz#IndentTestCase.test_roundtrip_mixed�s.���(�(�D����V�F�4��$<�=�t�D�)rc��d}d}t|j|�D]!\}}|jt||�|��#y�Nr�)�"  Hi.
  This is a test.
  Testing.z#  Hi.
  This is a test.

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

  Testing.

��zipr7rr�r�prefixrr#rs     r�test_indent_defaultz"IndentTestCase.test_indent_default�s@����
�� ��
�
�H�5�L�D�&����V�D�&�1�6�:�6rc��d}d}t|j|�D]"\}}|jt||d�|��$yrRrUrWs     r�test_indent_explicit_defaultz+IndentTestCase.test_indent_explicit_default�sB����
�� ��
�
�H�5�L�D�&����V�D�&�$�7��@�6rc��d}d}d�}t|j|�D]"\}}|jt|||�|��$y)Nr�)rSz%  Hi.
  This is a test.
  
  Testing.z&  
  Hi.
  This is a test.
  Testing.
rTz/  
  Hi.
  This is a test.
  
  Testing.
  
c��yr=r/r>s rr@z6IndentTestCase.test_indent_all_lines.<locals>.<lambda>�rArrU�rrXrrCr#rs      r�test_indent_all_linesz$IndentTestCase.test_indent_all_lines�sG����
��&�	���
�
�H�5�L�D�&����V�D�&�)�<�f�E�6rc��d}d}d�}t|j|�D]"\}}|jt|||�|��$y)Nr�)r2zHi.
This is a test.
  
Testing.z   
Hi.
This is a test.
Testing.
r3z)  
Hi.
This is a test.
  
Testing.
  
c�$�|j�Sr!)�stripr>s rr@z8IndentTestCase.test_indent_empty_lines.<locals>.<lambda>�s
��T�Z�Z�\�!1rrUr^s      r�test_indent_empty_linesz&IndentTestCase.test_indent_empty_lines�sG����
��2�	���
�
�H�5�L�D�&����V�D�&�)�<�f�E�6rN)r+r,r-rJr7r8r:rDrGrKrNrPrYr[r_rcr/rrr1r1xsY��
�O�
��
�E�5�
;�@�D�A�
A�
E�
;�$A�$F�&Frr1c�6�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	y)	�ShortenTestCasec�B�t||fi|��}|j||�yr!)rrr"s      r�
check_shortenzShortenTestCase.check_shortens!����u�/��/���
�
�6�6�"rc��d}|j|dd�|j|t|�|�|j|t|�dz
d�y)N�<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 [...]�rgrr@s  rrAzShortenTestCase.test_simplesO��M�����4��%9�:����4��T��D�1����4��T��Q��
 �	!rc��d}|j|ddd��|j|ddd��|j|ddd	��|j|t|�|d��|j|t|�d
z
dd��y)NrirrzHello there,$$z$$r�rjzHello there, how$$zHello there, $$z $$r`z:Hello there, how are you this fine day? I'm glad to hear$$rkr@s  rr�z ShortenTestCase.test_placeholders���M�����4��%5�4��H����4��%9�t��L����4��%6�E��J����4��T��D�d��C����4��T��Q��
!�.2�	�	4rc�*�|jddd�y)NrCrD�rgr4s rrGz!ShortenTestCase.test_empty_strings�����2�q�"�%rc���d}|j|dd�|j|dd�|jddd�|jdd	d
�|jddd�y)
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!  r8zhello world!�zhello [...]r�r�rnr@s  rrRzShortenTestCase.test_whitespacesx��,��	
���4��4�	5�	
���4��0�	1�	
���0�"�n�E����0�"�m�D�	
���0�"�g�>rc��tddd��|jt�5tddd��ddd�y#1swYyxYw)N�xxxxxxxxxxxxxxxxxxxx�z(......))r$r�z	(.......))rr�r�r4s r�$test_width_too_small_for_placeholderz4ShortenTestCase.test_width_too_small_for_placeholder.s4�����z�:�
�
�
�z�
*��H�A�;�?�+�
*�
*�s	�<�Ac�*�|jddd�y)N�Helloo�r�rnr4s r�-test_first_word_too_long_but_placeholder_fitsz=ShortenTestCase.test_first_word_too_long_but_placeholder_fits3s�����8�Q��0rN)
r+r,r-rgrAr�rGrRrvrzr/rrrere�s&��#�!�	4�&�?�$@�
1rre�__main__)�unittest�textwraprrrrrr�TestCaser
r1r�r�r�rr r1rer+�mainr/rr�<module>r�s����E�E�;�8�$�$�;�<n0�<�n0�b
\-�|�\-�~B%��B%�JF2�,�F2�P.#�l�.#�fv/�X�&�&�v/�tCF�X�&�&�CF�L61�l�61�r�z���H�M�M�O�r

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists