[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@3.146.176.1: ~ $


��Yf�7�@s4ddlZddlmZddlmZddlmZmZddl	m
Z
Gdd�dej�ZGdd	�d	ej�Z
Gd
d�dej�ZGdd
�d
ej�ZGdd�dej�ZGdd�d�ZGdd�d�ZGdd�dej�Zedkr0ejdddd�dS)�N)�FormatParagraph)�EditorWindow)�Tk�Text)�requiresc@sXeZdZdZdZdZdZdZdZdd�Z	d	d
�Z
dd�Zd
S)�Is_Get_TestzTest the is_ and get_ functionsz# This is a commentzThis is not a commentz# This is a comment   z    # This is a commentz    This is not a commentcCsI|jtjd��|jtjd��|jtj|j��dS)N�z	

)Z
assertTrue�fpZis_all_whiteZassertFalse�test_comment)�self�r�K/opt/alt/python35/lib64/python3.5/idlelib/idle_test/test_formatparagraph.py�test_is_all_whiteszIs_Get_Test.test_is_all_whitecCsq|j}|tj|j�d�|tj|j�d�|tj|j�d�|tj|j�d�dS)Nrz    )�assertEqualr	Z
get_indentr
�trailingws_comment�leadingws_comment�leadingws_nocomment)r�Equalrrr
�test_get_indents
	zIs_Get_Test.test_get_indentcCs�|j}|tj|j�d�|tj|j�d�|tj|j�d�|tj|j�d�|tj|j�d�dS)N�#z    #z    r)rr	Zget_comment_headerr
rrr�test_nocomment)rrrrr
�test_get_comment_headers	z#Is_Get_Test.test_get_comment_headerN)�__name__�
__module__�__qualname__�__doc__r
rrrrrrrrrrr
r	src@sLeZdZdZedd��Zdd�Zdd�Zdd	�Zd
S)�FindTesta`Test the find_paragraph function in FormatParagraph.

    Using the runcase() function, find_paragraph() is called with 'mark' set at
    multiple indexes before and inside the test paragraph.

    It appears that code with the same indentation as a quoted string is grouped
    as part of the same paragraph, which is probably incorrect behavior.
    cCs ddlm}|�|_dS)Nr)r)Zidlelib.idle_test.mock_tkr�text)�clsrrrr
�
setUpClass2szFindTest.setUpClassc	Cs�|j}|jd|�x�td|�D]v}t|jd|�jd�d�}xGd|d|fD]2}d||f}|jtj||�|�qiWq)W|j	dd�dS)	Nz1.0�z%d.end�.r�z%d.%d�end)
r�insert�range�int�index�splitrr	Zfind_paragraph�delete)	rZ
inserttextZstopline�expectedr�lineZ
linelength�colZ	tempindexrrr
�runcase7s	&$zFindTest.runcasec	Cs|d}|j|dddd|dd�f�d}|j|d	d
dd|dd
�f�d}|j|d	d
dd|dd�f�d}|j|dd
dd|dd�f�d}|j|dd
dd|dd�f�d}|j|dd
dd|dd�f�d}|j|dd
dd|dd�f�d}|j|dd
dd|dd�f�dS)Nz;# Comment block with no blank lines before
# Comment line

�z1.0z3.0rr�:zG
# Comment block with whitespace line before and after
# Comment line

�z2.0z4.0r �FzS
    # Indented comment block with whitespace before and after
    # Comment line

z    #�Rz
# Single line comment

�z4
    # Single line comment with leading whitespace

�3z0
# Comment immediately followed by code
x = 42

�(z=
    # Indented comment immediately followed by code
x = 42

�5z=
# Comment immediately followed by indented code
    x = 42

�1)r-)rZcommentrrr
�test_find_commentDs )))))))zFindTest.test_find_commentc	Cs�d}|j|dddd|dd�f�d}|j|d	d
dd|dd
�f�d}|j|d	d
dd|dd�f�d}|j|dd
dd|dd�f�d}|j|dd
dd|dd�f�dS)Nz6"""String with no blank lines before
String line
"""

r0z1.0z4.0rrr6zC
"""String with whitespace line before and after
String line.
"""

�z2.0z5.0r �BzV
    """Indented string with whitespace before and after
    Comment string.
    """

z    �Uz
"""Single line string."""

r.z3.0�z8
    """Single line string with leading whitespace."""

�7)r-)rZ
teststringrrr
�test_find_paragraphzs))))zFindTest.test_find_paragraphN)	rrrr�classmethodrr-r8r>rrrr
r(s

6rc@s"eZdZdZdd�ZdS)�ReformatFunctionTestz?Test the reformat_paragraph function without the editor window.cCs*|j}tj}d}||dd�d�||dd�d�|||d�d�|||d�d�|||d	�d
�|||d�d
�|||d�d�d
}|||d�d�|||d�d�|||d	�d�|||d�d�|||d�d
�dS)Nz
O hello world� r zHello    world�zHello  worldz
O
hello
world��z
O hello
world��
z
O hello worldz
O
hello
worldz
O hello
world)rr	Zreformat_paragraph)rrZreformZhwrrr
�test_reformat_paragraph�s 		z,ReformatFunctionTest.test_reformat_paragraphN)rrrrrGrrrr
r@�sr@c@s"eZdZdZdd�ZdS)�ReformatCommentTestz=Test the reformat_comment function without the editor window.cCsi|j}d}tj|dd�}d}|||�d}tj|dd�}d}|||�dS)Nzu    """this is a test of a reformat for a triple quoted string will it reformat to less than 70 characters for me?"""r1z    zy    """this is a test of a reformat for a triple quoted string will it
    reformat to less than 70 characters for me?"""zm# this is a test of a reformat for a triple quoted string will it reformat to less than 70 characters for me?rzo# this is a test of a reformat for a triple quoted string will it
# reformat to less than 70 characters for me?)rr	Zreformat_comment)rr�test_string�resultr*r
rrr
�test_reformat_comment�s	
z)ReformatCommentTest.test_reformat_commentN)rrrrrKrrrr
rH�srHc@seZdZdd�ZdS)�FormatClassTestcCsCtjd�}|j|jd�|j�|j|jd�dS)N�editor)r	rrZeditwin�close)r�instancerrr
�test_init_close�s
zFormatClassTest.test_init_closeN)rrrrPrrrr
rL�srLc@s@eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�TextWrappercCstd|�|_dS)N�master)rr)rrRrrr
�__init__�szTextWrapper.__init__cCst|j|�S)N)�getattrr)r�namerrr
�__getattr__�szTextWrapper.__getattr__cCsdS)Nr)rrrr
�undo_block_start�szTextWrapper.undo_block_startcCsdS)Nr)rrrr
�undo_block_stop�szTextWrapper.undo_block_stopN)rrrrSrVrWrXrrrr
rQ�srQc@s%eZdZdd�ZejZdS)�EditorcCst|�|_dS)N)rQr)r�rootrrr
rS�szEditor.__init__N)rrrrSrZget_selection_indicesrrrr
rY�srYc@s|eZdZdZdZdZdZedd��Zedd��Z	d	d
�Z
dd�Zd
d�Zdd�Z
dS)�FormatEventTestz�Test the formatting of text inside a Text widget.

    This is done with FormatParagraph.format.paragraph_event,
    which calls functions in the module as appropriate.
    zv    '''this is a test of a reformat for a triple quoted string will it reformat to less than 70 characters for me?'''
a    '''The first line is under the max width.
    The second line's length is way over the max width. It goes on and on until it is over 100 characters long.
    Same thing with the third line. It is also way over the max width, but FormatParagraph will fix it.
    '''
a,# The first line is under the max width.
# The second line's length is way over the max width. It goes on and on until it is over 100 characters long.
# Same thing with the third line. It is also way over the max width, but FormatParagraph will fix it.
# The fourth line is short like the first line.cCsPtd�t�|_td|j�}|jj|_tj|�j|_dS)NZguirZ)	rrrZrYrr	rZformat_paragraph_event�	formatter)rrMrrr
rs

zFormatEventTest.setUpClasscCs#|`|`|jj�|`dS)N)rr\rZZdestroy)rrrr
�
tearDownClasss
zFormatEventTest.tearDownClasscCsV|jjdd�|jd�|j|jjdd�d�|jjdd�dS)Nz1.0zShort line
ZDummyr$r#)rr$r\r�getr))rrrr
�test_short_lines
zFormatEventTest.test_short_linecCs�|j}|jd|j�|jdd�|jddd�|jdd�}d}|j||�|jdd�|jd|j�|jdd	d
�|jddd�|jdd�}d}|j||�|jdd�dS)Nz1.0r$�ParameterDoesNothing�limitr1zz    '''this is a test of a reformat for a triple quoted string will it
    reformat to less than 70 characters for me?'''
r#�selz1.11z1.endzv    '''this is a test of a reformat for a triple quoted string will it reformat
 to less than 70 characters for me?''')	rr$rIZmark_setr\r^rr)�tag_add)rrrJr*rrr
�test_long_line!s	zFormatEventTest.test_long_linecCs~|j}|jd|j�|jddd�|jddd�|jdd�}d	}|j||�|jdd
�dS)Nz1.0rbz2.0z4.0r`rar1r$z�    The second line's length is way over the max width. It goes on and
    on until it is over 100 characters long. Same thing with the third
    line. It is also way over the max width, but FormatParagraph will
    fix it.
r#)rr$�multiline_test_stringrcr\r^rr))rrrJr*rrr
�test_multiple_lines<s	z#FormatEventTest.test_multiple_linescCs�|j}|jd|j�|jddd�|jdd�}d}|j||�|jdd�|jd|j�|jdd	d
�|jddd�|jdd�}d}|j||�|jdd�dS)Nz1.0r`rar1r$a/# The first line is under the max width. The second line's length is
# way over the max width. It goes on and on until it is over 100
# characters long. Same thing with the third line. It is also way over
# the max width, but FormatParagraph will fix it. The fourth line is
# short like the first line.
r#rbz2.0z3.0z�# The first line is under the max width.
# The second line's length is way over the max width. It goes on and
# on until it is over 100 characters long.
)rr$�multiline_test_commentr\r^rr)rc)rrrJr*rrr
�test_comment_blockKs	z"FormatEventTest.test_comment_blockN)rrrrrIrergr?rr]r_rdrfrhrrrr
r[�s	r[�__main__�	verbosityr"�exit)ZunittestZidlelibrr	Zidlelib.EditorWindowrZtkinterrrZtest.supportrZTestCaserrr@rHrLrQrYr[r�mainrrrr
�<module>sw�

Filemanager

Name Type Size Permission Actions
__init__.cpython-35.opt-1.pyc File 823 B 0644
__init__.cpython-35.opt-2.pyc File 496 B 0644
__init__.cpython-35.pyc File 823 B 0644
htest.cpython-35.opt-1.pyc File 11.44 KB 0644
htest.cpython-35.opt-2.pyc File 9.17 KB 0644
htest.cpython-35.pyc File 11.44 KB 0644
mock_idle.cpython-35.opt-1.pyc File 2.4 KB 0644
mock_idle.cpython-35.opt-2.pyc File 1.71 KB 0644
mock_idle.cpython-35.pyc File 2.4 KB 0644
mock_tk.cpython-35.opt-1.pyc File 11.12 KB 0644
mock_tk.cpython-35.opt-2.pyc File 6.29 KB 0644
mock_tk.cpython-35.pyc File 11.12 KB 0644
test_autocomplete.cpython-35.opt-1.pyc File 4.95 KB 0644
test_autocomplete.cpython-35.opt-2.pyc File 4.93 KB 0644
test_autocomplete.cpython-35.pyc File 4.95 KB 0644
test_autoexpand.cpython-35.opt-1.pyc File 4.13 KB 0644
test_autoexpand.cpython-35.opt-2.pyc File 4.06 KB 0644
test_autoexpand.cpython-35.pyc File 4.13 KB 0644
test_calltips.cpython-35.opt-1.pyc File 10.01 KB 0644
test_calltips.cpython-35.opt-2.pyc File 9.88 KB 0644
test_calltips.cpython-35.pyc File 10.09 KB 0644
test_config_help.cpython-35.opt-1.pyc File 4.31 KB 0644
test_config_help.cpython-35.opt-2.pyc File 4.23 KB 0644
test_config_help.cpython-35.pyc File 4.31 KB 0644
test_config_name.cpython-35.opt-1.pyc File 3.16 KB 0644
test_config_name.cpython-35.opt-2.pyc File 3.08 KB 0644
test_config_name.cpython-35.pyc File 3.16 KB 0644
test_configdialog.cpython-35.opt-1.pyc File 1.43 KB 0644
test_configdialog.cpython-35.opt-2.pyc File 1.27 KB 0644
test_configdialog.cpython-35.pyc File 1.43 KB 0644
test_delegator.cpython-35.opt-1.pyc File 1.1 KB 0644
test_delegator.cpython-35.opt-2.pyc File 1.09 KB 0644
test_delegator.cpython-35.pyc File 1.1 KB 0644
test_editmenu.cpython-35.opt-1.pyc File 2.88 KB 0644
test_editmenu.cpython-35.opt-2.pyc File 2.48 KB 0644
test_editmenu.cpython-35.pyc File 2.88 KB 0644
test_editor.cpython-35.opt-1.pyc File 1.19 KB 0644
test_editor.cpython-35.opt-2.pyc File 1.17 KB 0644
test_editor.cpython-35.pyc File 1.19 KB 0644
test_formatparagraph.cpython-35.opt-1.pyc File 12.41 KB 0644
test_formatparagraph.cpython-35.opt-2.pyc File 11.65 KB 0644
test_formatparagraph.cpython-35.pyc File 12.41 KB 0644
test_grep.cpython-35.opt-1.pyc File 3.08 KB 0644
test_grep.cpython-35.opt-2.pyc File 2.54 KB 0644
test_grep.cpython-35.pyc File 3.08 KB 0644
test_help_about.cpython-35.opt-1.pyc File 1.96 KB 0644
test_help_about.cpython-35.opt-2.pyc File 1.82 KB 0644
test_help_about.cpython-35.pyc File 1.96 KB 0644
test_hyperparser.cpython-35.opt-1.pyc File 8 KB 0644
test_hyperparser.cpython-35.opt-2.pyc File 7.81 KB 0644
test_hyperparser.cpython-35.pyc File 8 KB 0644
test_idlehistory.cpython-35.opt-1.pyc File 6.72 KB 0644
test_idlehistory.cpython-35.opt-2.pyc File 6.57 KB 0644
test_idlehistory.cpython-35.pyc File 6.72 KB 0644
test_io.cpython-35.opt-1.pyc File 8.76 KB 0644
test_io.cpython-35.opt-2.pyc File 8.75 KB 0644
test_io.cpython-35.pyc File 8.76 KB 0644
test_parenmatch.cpython-35.opt-1.pyc File 4.06 KB 0644
test_parenmatch.cpython-35.opt-2.pyc File 3.61 KB 0644
test_parenmatch.cpython-35.pyc File 4.06 KB 0644
test_pathbrowser.cpython-35.opt-1.pyc File 1.31 KB 0644
test_pathbrowser.cpython-35.opt-2.pyc File 1.29 KB 0644
test_pathbrowser.cpython-35.pyc File 1.31 KB 0644
test_percolator.cpython-35.opt-1.pyc File 5.18 KB 0644
test_percolator.cpython-35.opt-2.pyc File 5.13 KB 0644
test_percolator.cpython-35.pyc File 5.18 KB 0644
test_replacedialog.cpython-35.opt-1.pyc File 7.5 KB 0644
test_replacedialog.cpython-35.opt-2.pyc File 7.43 KB 0644
test_replacedialog.cpython-35.pyc File 7.5 KB 0644
test_rstrip.cpython-35.opt-1.pyc File 1.55 KB 0644
test_rstrip.cpython-35.opt-2.pyc File 1.54 KB 0644
test_rstrip.cpython-35.pyc File 1.55 KB 0644
test_searchdialog.cpython-35.opt-1.pyc File 2.42 KB 0644
test_searchdialog.cpython-35.opt-2.pyc File 2.34 KB 0644
test_searchdialog.cpython-35.pyc File 2.42 KB 0644
test_searchdialogbase.cpython-35.opt-1.pyc File 5.79 KB 0644
test_searchdialogbase.cpython-35.opt-2.pyc File 5.58 KB 0644
test_searchdialogbase.cpython-35.pyc File 5.79 KB 0644
test_searchengine.cpython-35.opt-1.pyc File 10.7 KB 0644
test_searchengine.cpython-35.opt-2.pyc File 10.61 KB 0644
test_searchengine.cpython-35.pyc File 10.7 KB 0644
test_text.cpython-35.opt-1.pyc File 6.86 KB 0644
test_text.cpython-35.opt-2.pyc File 6.84 KB 0644
test_text.cpython-35.pyc File 6.86 KB 0644
test_textview.cpython-35.opt-1.pyc File 3.86 KB 0644
test_textview.cpython-35.opt-2.pyc File 3.53 KB 0644
test_textview.cpython-35.pyc File 3.86 KB 0644
test_undodelegator.cpython-35.opt-1.pyc File 4.57 KB 0644
test_undodelegator.cpython-35.opt-2.pyc File 4.3 KB 0644
test_undodelegator.cpython-35.pyc File 4.57 KB 0644
test_warning.cpython-35.opt-1.pyc File 2.84 KB 0644
test_warning.cpython-35.opt-2.pyc File 2.5 KB 0644
test_warning.cpython-35.pyc File 2.84 KB 0644
test_widgetredir.cpython-35.opt-1.pyc File 5.49 KB 0644
test_widgetredir.cpython-35.opt-2.pyc File 5.4 KB 0644
test_widgetredir.cpython-35.pyc File 5.49 KB 0644