403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.216.202
Web Server : Microsoft-IIS/10.0
System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64
User : IUSR ( 0)
PHP Version : 8.3.28
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Python312/Lib/idlelib/idle_test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python312/Lib/idlelib/idle_test/__pycache__/test_configdialog.cpython-312.pyc
�

���g����V�dZddlmZddlmZed�ddlmZddlZddlmZddl	m
Z
dd	lmZm
Z
mZmZmZmZdd
lmZddlmZmZmZej.Zej2d�ej2d�ej2d�ej2d�d
�ZdadaedZedZedZedZ d�Z!d�Z"Gd�dejF�Z$Gd�dejFe�Z%Gd�dejF�Z&Gd�dejF�Z'Gd�dejF�Z(Gd�dejF�Z)Gd �d!ejF�Z*Gd"�d#ejF�Z+Gd$�d%ejF�Z,Gd&�d'ejF�Z-e.d(k(rej^d)�*�yy)+zfTest configdialog, coverage 94%.

Half the class creates dialog, half works with user customizations.
�)�configdialog)�requires�gui)�ExtraAssertionsN)�mock)�Func)�Tk�	StringVar�IntVar�
BooleanVar�DISABLED�NORMAL)�config)�idleConf�changes�tracers�)�main�	highlight�keys�
extensionsrrrrc�n�tt_t�atjtdd��ay)N�TestT)�_utest)�testcfgr�userCfgr	�rootr�ConfigDialog�dialog���8C:\Python312\\Lib\idlelib\idle_test\test_configdialog.py�setUpModuler##s%���H��
�4�D�
�
&�
&�t�V�D�
A�Fr!c���tt_tj�tj
�t
j
�tj�tj�dxaa
y�N)�usercfgrrr�detach�clearrr�update_idletasks�destroyrr r!r"�tearDownModuler++sE���H���N�N���M�M�O��M�M�O������L�L�N���D�6r!c��eZdZd�Zd�Zy)�ConfigDialogTestc��yr%r ��selfs r"�test_deactivate_current_configz/ConfigDialogTest.test_deactivate_current_config8���r!c��yr%r r/s r"�activate_config_changesz(ConfigDialogTest.activate_config_changes;r2r!N)�__name__�
__module__�__qualname__r1r4r r!r"r-r-6s��
�
r!r-c�$�eZdZd�Zd�Zd�Zd�Zy)�
ButtonTestc��t}tj�x}|_tj�x}|_|j
dj
�|j�|j�|`|`y)N�Ok)rr�Mock�applyr*�buttons�invoke�assert_called_once)r0�dr=r*s    r"�
test_click_okzButtonTest.test_click_okAs`�����)�)�+�%����"�i�i�k�)��!�)�	�	�	�$���� �
� � �"��"�"�$�
�I�q�wr!c��t}tj�x}|_tj�x}|j_tj�x}|_|jdj�|j�|j�|j�|j`|`|`y)N�Apply)
rrr<�deactivate_current_config�extpage�save_all_changed_extensionsr4r>r?r@)r0rA�
deactivate�save_ext�activates     r"�test_click_applyzButtonTest.test_click_applyJs�����37�9�9�;�>�
�Q�0�;?�9�9�;�F��1�9�9�8�/3�y�y�{�:��1�,�	�	�	�'��!�!�#��%�%�'��#�#�%��#�#�%�
�I�I�1�
�%�q�'Br!c��t}t�|_dtdd<|jdj�|j
tdi�|j
|jjd�|`y)N�r�	something�Cancel)rrr*rr>r?�assertEqual�called�r0rAs  r"�test_click_cancelzButtonTest.test_click_cancelVsf�����F��	�'(�����$�	�	�	�(��"�"�$�������"�-�������)�)�1�-�
�Ir!c���tjjtj�tj
j
tdt��5}tjdj�|jd|jd}}ddd�|jd�|jd�|j|d�y#1swY�@xYw)	N�	view_text)�new_callable�Help�title�contentszHelp for IDLE preferenceszWhen you clickza different name.
)r�note�select�keyspager�patch�objectrrr>r?�kwdsrP�assertStartsWith�assertEndsWith)r0�viewrXrYs    r"�test_click_helpzButtonTest.test_click_help_s��������6�?�?�+�
�Z�Z�
�
�|�[�,0��2�59��N�N�6�"�)�)�+�"�i�i��0�$�)�)�J�2G�8�E�2�	
���� ;�<����h�(8�9����H�%:�;�
2�2�s
�AC�C N)r5r6r7rBrKrSrcr r!r"r9r9?s���
C��<r!r9c�`�eZdZdZed��Zed��Zd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zy)
�FontPageTestz�Test that font widgets enable users to make font changes.

    Test that widget actions set vars, that var changes add three
    options to changes and call set_samples, and that set_samples
    changes the font of both sample boxes.
    c��tjx}|_tjj	|�t�|_|j�yr%)r�fontpage�pagerZr[r�set_samples�update��clsrhs  r"�
setUpClasszFontPageTest.setUpClassqs7�� �/�/�)��s�x������4� ��6������
r!c��|j`yr%)rhri�rls r"�
tearDownClasszFontPageTest.tearDownClassxs���H�H� r!c�,�tj�yr%�rr(r/s r"�setUpzFontPageTest.setUp|����
�
�r!c��tj�|j}|jj	d�|j
j	d�|jj	d�d|j_|j�|j|jj�d�|j|j
j�d�|j|jj��|j|jjd�tj�y)N�Fake�1TrrM)rr'rh�	font_name�set�	font_size�	font_boldrirQ�
load_font_cfg�assertNotEqual�get�assertFalserP�attachrRs  r"�test_load_font_cfgzFontPageTest.test_load_font_cfgs���	�����I�I��	�������	�������	������� ��
�
��	�������A�K�K�O�O�-�v�6����A�K�K�O�O�-�s�3���������*�+�������-�-�q�1����r!c�\�|j}|jj�dkr|jd�|j}|j	d�|jjd�}|j
�|j�|jd�|jd�|jd�}|j||�|j|jj�|j��|j
�|j�|jd�|jd�|jd�}|j||�|j|jj�|j��y)	N��need at least 2 fontsr�activez
<Key-Down>z<KeyRelease-Down>z<Key-Up>z<KeyRelease-Up>)rh�fontlist�size�skipTestrJr~�focus_forcerj�event_generater}�assertInrx�lowerrP)r0rAr��font�	down_font�up_fonts      r"�test_fontlist_keyzFontPageTest.test_fontlist_key�s9���I�I���:�:�?�?��q� ��M�M�1�2��:�:�����!���z�z�~�~�h�'��	������������-���� 3�4��L�L��*�	����I�t�,��
�
�a�k�k�o�o�'����):�;�	�����������
�+���� 1�2��,�,�x�(������$�'��
�
�a�k�k�o�o�'�����9r!c��|j}|jj�dkr|jd�|j}|j	d�|j�|j
d�|j�|jd�\}}}}||dzz
}||dzz
}|jd||��|jd||��|jd�}|jd�}|j||�|j|jj�|j��y)	Nr�r�rrM�
<Button-1>��x�y�<ButtonRelease-1>�anchor)rhr�r�r�rJr��seerj�bboxr�r~rPr�rxr�)	r0rAr�r�r��dx�dy�font1�select_fonts	         r"�test_fontlist_mousez FontPageTest.test_fontlist_mouse�s
���I�I���:�:�?�?��q� ��M�M�1�2��:�:�����!��	�������Q�������}�}�Q�'���1�b�"�	�R�1�W���	�R�1�W��������Q��7���� 3�q�A��>����Q����l�l�8�,������e�,��
�
�a�k�k�o�o�'�����7r!c��|j}|jjjd�|j	|j
j
�d�y)N�(�40)rh�sizelist�variableryrPrzr~rRs  r"�
test_sizelistzFontPageTest.test_sizelist�s>���I�I��	�
�
������#���������*�D�1r!c�^�|j}|jjd�|jj	�|j|jj
��|jj	�|j|jj
��y)NF)rhr{ry�bold_toggler?�
assertTruer~rrRs  r"�test_bold_togglezFontPageTest.test_bold_toggle�sk���I�I��	�������	�
�
������������)�*�	�
�
������������*�+r!c���tjtdd�}t|d�}|ddk(}|j}|j
j
|�|jj
|�d|j_	|jj
d�dd|t|�d�i}|jt|�|j|jjd�tj�|j
j
d	�ddd	t|�d�i}|jt|�|j|jjd�tj�|jj
|�ddd	t|�d�i}|jt|�|j|jjd
�y)Nr�EditorWindowrMr��boldrz	Test Font)r�z	font-sizez	font-bold�20�)r�GetFontr�strrhrzryr{rirQrxrP�mainpagerr()r0�default_font�default_size�default_boldrA�expecteds      r"�
test_font_setzFontPageTest.test_font_set�s���
 �'�'��f�n�E���<��?�+��#�A��&�0���I�I��	������%�	������%� ��
�
��	������$�"�[�2>�25�l�2C�%E�F��	
����8�,�������-�-�q�1��
�
��	�������"�[�26�25�l�2C�%E�F��	
����8�,�������-�-�q�1��
�
��	�����L�(�)�"�[�26�25�,�6F�2G�%I�J��	
����8�,�������-�-�q�1r!c���|j}|`|j|jf}iic|_|_|jjd�|jjd�|jjd�ddi}|j�|j|j|jcxk(xr|k(nc�|\|_|_t�|_y)N�test�5rMr�)r�r�r�)
rhri�font_sample�highlight_samplerxryrzr{r�r)r0rA�orig_samplesr�s    r"�test_set_sampleszFontPageTest.test_set_samples�s����I�I��
�M��}�}�a�&8�&8�8��,.��)��
�q�)�	�������	�������	��������1�2��	
�
�
������
�
��);�);�G�x�G�H�,8�)��
�q�)����
r!N)r5r6r7�__doc__�classmethodrmrprsr�r�r�r�r�r�r�r r!r"rerejsX��������!��!��� :�:8�.2�,�"2�Hr!rec��eZdZdZed��Zed��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�Zy)�HighPageTestz�Test that highlight tab widgets enable users to make changes.

    Test that widget actions set vars, that var changes add
    options to changes and that themes work correctly.
    c��tjx}|_tjj	|�t�|_t�|_t�|_t�|_	|j�yr%)r�highpagerhrZr[r�set_theme_type�paint_theme_sample�set_highlight_target�set_color_samplerjrks  r"rmzHighPageTest.setUpClasssU�� �/�/�)��s�x������4� �"�f���"&�&���$(�F��!� $�������
r!c�,�|j}|`|`|`|`yr%)rhr�r�r�r�)rlrAs  r"rpzHighPageTest.tearDownClasss!���H�H��
��a�2�
�"�A�$6r!c�F�|j}tjdd�D]$}tjdj	|��&tj�d|j_d|j_d|j_d|j_y)N�userrr)rhr�GetSectionListr�remove_sectionrr(r�rQr�r�r��r0rA�sections   r"rszHighPageTest.setUps���I�I�� �.�.�v�{�C�G����[�)�8�8��A�D��
�
��"#�����&'����#�()����%�$%����!r!c�x�tj�|j}|j}t	j
d��t_|j�|j|jj��||jj�d�||jj�d�||jj�d�||j j"d�||j$j"d�||j&j"d�t
j(dddd	�t
j(dd
dd�|j�||jj�d�||jj�d�||j j"d
�||j$j"d
�||j&j"d
�t	j
d
��t_t
j(dddd�|j�|j+|jj��||jj�d�||jj�d
�||j j"d�||j$j"d�||j&j"d�t`tj,�y)N�IDLE Classic��return_value�- no custom themes -��disabledrMr�test1�option�value�test2�option2�value2r�r�Theme�default�0r�)rr'rhrPrr<r�CurrentTheme�load_theme_cfgr��theme_sourcer~�builtin_name�custom_name�custom_theme_on�stater�rQr�r��	SetOptionrr��r0rA�eqs   r"�test_load_theme_cfgz HighPageTest.test_load_theme_cfg+sV�������I�I��
�
�
��!%�	�	�~� F���	����������*�*�,�-�
�1�>�>�����0�
�1�=�=���� 6�7�
�1���"�"�$�m�4�
�1���"�"�A�&�
�1���&�&��*�
�1�!�!�(�(�!�,�	���;���7�C����;���H�E�	����
�1�>�>�����0�
�1�=�=�����(�
�1���"�"�A�&�
�1���&�&��*�
�1�!�!�(�(�!�,�!%�	�	�w� ?������6�7�I�s�;�	����������+�+�-�.�
�1�>�>�����0�
�1�=�=�����(�
�1���"�"�A�&�
�1���&�&��*�
�1�!�!�(�(�!�,��!����r!c�|�|j}|j}t�|_t�|_|j
j
�|tdddii�||jjd�||jjd�tj�|jjd�|jj
�|jtdddii�||jjd�||jjd�|`|`y)Nr�r��TruerMr�z	!disabled�False)
rPrhr�var_changed_builtin_name�var_changed_custom_name�builtin_theme_onr?r�rQrr(r�r��r0r�rAs   r"�test_theme_sourcezHighPageTest.test_theme_sourceTs���
�
�
���I�I��%)�V��"�$(�F��!�	���!�!�#�
�8�g�	�6�2�3�4�
�1�%�%�,�,�a�0�
�1�$�$�+�+�Q�/��
�
��	
������/�	��� � �"�����G�i��-A�#B�C�
�1�%�%�,�,�a�0�
�1�$�$�+�+�Q�/�
�&��(Ar!c�0�|j}|j}gd�}tjdddd�|jj|d�|tdddd�i�||jd	d
�||jjd�tj�tjdddd�|jj|d�|tdd
dii�||jd	d
�||jjd�tj�|jj|d�|tdddd�i�||jd	d�||jjd�y)N)r��	IDLE Dark�IDLE Newrr��name�spamr�r��r��name2�textzNew theme, see HelprMr�r�r�rr�)rPrhrr��builtinlist�SetMenur��
theme_messager�rQrr(�r0r�rA�	item_lists    r"�test_builtin_namezHighPageTest.test_builtin_nameisW��
�
�
���I�I��=�	�	���6�7�F�F�;�	�
�
���i��5�
�8�g��)4� 6�7�	8�
�1�?�?�6�"�$9�:�
�1���&�&��*�	�
�
�����6�7�F�J�?�	�
�
���i��5�
�8�g���5�6�7�
�1�?�?�6�"�$9�:�
�1���&�&��*�	�
�
��	�
�
���i��8�
�8�g���D�E�F�
�1�?�?�6�"�B�'�
�1���&�&��*r!c��|j}|jjgd�|jdt�|j|jjd�tj�|jjgd�d�|jtdddii�|j|jjd�y)Nr�r�r��a�b�crr�rM)
rh�
customlistr��assertNotInr�rPr�rQrr(rRs  r"�test_custom_namezHighPageTest.test_custom_name�s����I�I��	
�����R�!7�8�����(�+�����-�-�4�4�a�8�	�
�
��	�����_�c�2�����G�f�c�]�#;�<�����-�-�4�4�a�8r!c��|j}t�|_|jj	d�|j|jjd�|`y)N�greenrM)rhr�on_new_color_set�colorryrPrQrRs  r"�
test_colorzHighPageTest.test_color�sG���I�I��!�V���	�����G������+�+�2�2�A�6�
�r!c���|j}|j}|jjgd�d�||jj�d�||jjd�y)NrrrM)rPrh�
targetlistr��highlight_targetr~r�rQr�s   r"� test_highlight_target_list_mousez-HighPageTest.test_highlight_target_list_mouse�sY��
�
�
���I�I��	�����_�c�2�
�1���!�!�#�S�)�
�1�!�!�(�(�!�,r!c����|j}|j}|j��j��fd�}|jj�D��cic]\}}||��
}}}d}�j
�D]d}	|�j|d�d�||jj�||�|dz
}||jj|��fycc}}w#t$rY�ywxYw)Nc�4���j|��j��j|�\}}}}||dzz
}||dzz
}�jddd���jd||���jd||���jd||��y)	z'Simulate click on character at *index*.r��<Enter>rr��<Motion>�<ButtonPress-1>r�N)r�r)r�r�)�indexr�r�r�r��hss     �r"�
click_charzAHighPageTest.test_highlight_target_text_mouse.<locals>.click_char�s�����F�F�5�M����!��7�7�5�>�L�A�q�"�b�
��q��L�A�
��q��L�A����i�1���2����j�A���3����/�1���:����1�Q�!��<r!r�1.0rM)
rPrhr�r��theme_elements�items�	tag_names�
tag_nextrangerr~r�rQ�
IndexError)	r0r�rAr�element�tag�elem�countrs	        @r"� test_highlight_target_text_mousez-HighPageTest.test_highlight_target_text_mouse�s����
�
�
���I�I��
�
�
��
����
	=�23�1A�1A�1G�1G�1I�J�1I���#��W��1I��J����<�<�>�C�
��2�+�+�C��7��:�;��1�%�%�)�)�+�T�#�Y�7���
���1�)�)�0�0�%�8�"��K���
��
�s�
C"�>A!C(�(	C4�3C4c��|j}|j}|j}|j�|j	d�|j�|j
ddd��|j
ddd��td�D]*}|j
ddd��|j
ddd���,||jd	�d
�y)N��?rrr�rr�rr��selr )	rPrhr�r�r�r)r��range�
tag_ranges)r0r�rAr�_s     r"�"test_highlight_sample_double_clickz/HighPageTest.test_highlight_sample_double_click�s���
�
�
���I�I��
�
�
��
����
���s��
����	���)�q�A��.�
���*��Q��/��q��A����/�1���:����1�Q�!��<��	�2�=�=����$r!c���|j}|j}|j}|j�|j	d�|j�|j
d�\}}}}}|jd�|jd�|jd||��|jd||��|jd||��|jd	||��||jd
�d�y)Nr%rz<Leave>rrr�rz<B1-Motion>r�r&r )	rPrhr�r�r�r)�	dlineinfor�r()	r0r�rArr�r�r�r��offsets	         r"�test_highlight_sample_b1_motionz,HighPageTest.test_highlight_sample_b1_motion�s���
�
�
���I�I��
�
�
��
����
���s��
����!�|�|�E�2���1�b�"�f�	���)�$�
���)�$�
���*��Q��/�
���+�q�A��6�
���-�2���4�
���-��r��:�
�2�=�=����$r!c��|j}|j}|`|jj	d�|j�||j
dt�||jdt�||jj�d�|jj	d�|j�||j
dt�||jj�d�||jdt�||jj�d�t�|_y�NTr�r�F��selectedr )
rPrhr�r�ryr�rrr
�button_delete_customr�r�rr�s   r"�test_set_theme_typez HighPageTest.test_set_theme_type�s���
�
�
���I�I��
��	
�����4� �	����
�1�=�=��!�6�*�
�1�<�<�� �(�+�
�1�!�!�'�'�)�=�9�	
�����5�!�	����
�1�=�=��!�8�,�
�1���"�"�$�m�4�
�1�<�<�� �&�)�
�1�!�!�'�'�)�2�.��6��r!c��|j}|j}tjj}t�x}tj_t�x}|_|jjd�|jjd�d|_
|jj�||jj�d�d|jj|j dd�f|_
|jj�||jj�d�d|_
|jjd�|j"jd�d|_
|jj�||j$d	�||jj�d�d
|_
|jj�||j&j�|j�||jj�d�|jjd�|j"jd�|jj�||jj�d�|`|tj_y)
NzEditor Breakpointz#ffffff)NNr�style�
background))g��k@�r8�#de0000TrMzMy New Themer9F)rPrhr�colorchooser�askcolorr�get_new_theme_namerryr�result�button_set_colorr?r~r6�lookup�frame_color_setr�rQr�)r0r�rA�orig_chooser�chooser�gntns      r"�test_get_colorzHighPageTest.test_get_colors���
�
�
���I�I��#�0�0�9�9��7;�v�=��,�+�+�4�&*�f�,��q�#�	�����2�3�	�����I��&���	���!�!�#�
�1�7�7�;�;�=�)�$��a�g�g�n�n�Q�->�->�w�-G��V�W���	���!�!�#�
�1�7�7�;�;�=�)�$�>���	
�����I��	�����4� ����	���!�!�#�
�4�;�;���
�1�7�7�;�;�=�)�$�$���	���!�!�#�
�1�=�=�������,�
�1�7�7�;�;�=�)�$�	
�����I��	�����5�!�	���!�!�#�
�1�7�7�;�;�=�)�$�
� �-9��!�!�*r!c��|j}d}|jjd�|jjd�|jjd�|j
j|�|j
|jj|jdd�|�|j
|jjdd�|�|j
tdd	|ii�y)
Nz#3f7cae�Python�
Selected TextTr6r7�hilite�
foregroundzhilite-foreground)
rhr�ryr�fg_bg_togglerrPr6r?r@r��tag_cgetr�)r0rArs   r"�test_on_new_color_setz"HighPageTest.test_on_new_color_set4s����I�I����	�
�
���(�#�	������/�	�����4� �	�����E�����������(9�(9�'�(B�L�Q�SX�Y�����+�+�4�4�X�|�L�e�T�����"�%8�%�$@�A�	Cr!c���tj}td��x}t_|j}d|_|j|j
d�d�|t_y)NT��return_selfz	New Themer)r�SectionNamerrhr=rPr<�r0�orig_sectionname�snrAs    r"�test_get_new_theme_namez$HighPageTest.test_get_new_theme_nameAsS��'�3�3��(,��(>�>��\�
%��I�I����	�����-�-�b�1�;�?�#3�� r!c��|j}t�x}|_|jj	d�d|_|jj�|j|j
tjd�d|_d|_|j|j
tjd�|jj�|j|j
tjd�|`y)NTrrzmy new themer)
rhrr<r�ryr=�button_save_customr?rrrrQr�)r0rArCs   r"�test_save_as_new_themez#HighPageTest.test_save_as_new_themeKs����I�I��&*�f�,��q�#�	�����4� ����	���#�#�%�������h�&6�&6�{�&C�D�%������������h�&6�&6�{�&C�D�	���#�#�%��
�
�d�k�k�8�#3�#3�K�#@�A�
� r!c�L�|j}|j}|jjd�|jjd�d}d}|j|tj�|j|�|t
jdd�|g�|t
jdd�t
jd|��||jj�|�|j|jj��||jjd�t!j"d|d	d
�|j|tj�|j|�|t
jdd�||g�|j%t
jd|�t
jd|��t
j&d|d	d
�|t
jd|�t
jd|��y)NTr�zmy new custom themezmy second custom themer�rr�rMzhit-background�yellow)rPrhr�ryr�rrr�
create_newr��GetThemeDictr�r~rr�rQr�
add_optionr}r��r0r�rA�	first_new�
second_news     r"�test_create_new_and_save_newz)HighPageTest.test_create_new_and_save_new^s���
�
�
���I�I��	
�����4� �	�����>�*�)�	�-�
�	
����H�$4�$4�5�	���Y��
�8�"�"�6�;�7�)��E�
�8� � ��N�;�� � ���3�	5�
�1�=�=����	�*�������+�+�-�.�
�1���"�"�A�&�	���;�	�3C�X�N�����X�%5�%5�6�	���Z� �
�8�"�"�6�;�7�)�Z�9P�Q����H�1�1�&�)�D�$�1�1�&�*�E�	G�	���;�	�3C�X�N�
�8� � ���3�� � ���4�	6r!c��|j}|j}|`|jj	d�||j
j
�d�||jj
�d�|j|j�||jjd�|jj	d�||j
j
�d�||jj
�d�|j|j�||jjd�t�|_y)	N�Cursor)r�r2r�rM�Commentr1r r�)
rPrhr�rry�fg_onr��bg_onr�rJr�rQrr�s   r"�test_set_highlight_targetz&HighPageTest.test_set_highlight_target~s���
�
�
���I�I��
�"�	
�����x�(�
�1�7�7�=�=�?�4�5�
�1�7�7�=�=�?�M�*�������'�
�1���$�$�a�(�	
�����y�)�
�1�7�7�=�=�?�M�*�
�1�7�7�=�=�?�B��������'�
�1���$�$�a�(�!%���r!c��|j}|j}|jj�|j	|j
d�|jj�|j	|j
d�y)NrMr�)rhr�rdr?rPrQre)r0rA�scss   r"�test_set_color_sample_bindingz*HighPageTest.test_set_color_sample_binding�sZ���I�I��� � ��	������������Q�'�	������������Q�'r!c�p�|j}|`|jjd�|jjd�|j�|j|jj|jdd�|jjdd��t�|_y)NrGTr6r7rHrI)rhr�rryrJrPr6r?r@r�rKrrRs  r"�test_set_color_samplez"HighPageTest.test_set_color_sample�s����I�I��
��	������/�	�����4� �	������������q�0�0��9�<�H��"�"�+�+�H�l�C�	E�"�V��r!c�,�|j}|j}|`|jj}t
j}|jjd�|jjd�d}|j|�d|j_|j�ddd�}|j�D]\}}|j|d|�|�� ||jjd	�|j�D] \}}tj d
|d|z|��"|j�|j�D]\}}||d|�|��||jjd�t#�|_y)
NTr�z	IDLE Testr�bluerY)rIr7�consolerMrzconsole-r�)rPrhr�r�rKr�GetHighlightr�ryr�rZr�rQrr}rr\r)	r0r�rh�hs_tag�gh�theme�new_console�keyr�s	         r"�test_paint_theme_samplez$HighPageTest.test_paint_theme_sample�se��
�
�
���y�y���#��&�&�/�/��
�
"�
"��	
�����d�#������k�*��������'(����$�	
���!�%+�%-�0��%�+�+�-�J�C������y�#� 6��>�.�
�4� � �'�'��+�&�+�+�-�J�C�����{�E�:�c�>�5�I�.����!�%�+�+�-�J�C���v�i��%�u�-�.�
�4� � �'�'��+�"&�&��r!c�8�|j}|j}|jjd�t	�x}|_t	�t_t	�t_d}tjdj|dd�ddit|<d}tjdj|dd�dd	it|<|jjd�|jj�|jj!|�d
|_|jj�||j$d�|t|ddi�|tj&dd�||g�|tjj$d
�|tjj$d
�||j(j$d
�d|_|jj�||j$d�|j+|t�|tj&dd�|g�||jj�d�||jj-�|�|tjj$d�|tjj$d�||j(j$d�|jj!|�d|_|jj�||j$d�|j+|t�|tj&dd�g�||jj�d�||jj-�d�|tjj$d�|tjj$d�||j(j$d�t`t`|`y)Nr�z
spam themerr�r�r�r�zother themer�FrMr�rTr�r r�r�r�)rPrhr3r�r�askyesnorrEr4rrr�r�r�r?r�ryr=rQr�r�rr~)r0r�rA�yesno�
theme_name�theme_name2s      r"�test_delete_customzHighPageTest.test_delete_custom�s,��
�
�
���I�I��	���$�$�^�4�!�V�#���
�+/�6��(�)-���&�!�
�����%�/�/�
�F�G�L� (�&�1����#������%�/�/��V�W�M�!)�7� 3����	
������/�	��� � �"�	�
�
���*�%����	���%�%�'�
�5�<�<���
�8�J��(�F�!3�4�
�8�"�"�6�;�7�*�k�9R�S�
�6�+�+�2�2�A�6�
�6�)�)�0�0�!�4�
�1���"�"�A�&����	���%�%�'�
�5�<�<�������X�.�
�8�"�"�6�;�7�+��G�
�1���"�"�$�b�)�
�1�=�=�����,�
�6�+�+�2�2�A�6�
�6�)�)�0�0�!�4�
�1���"�"�A�&�	
�
�
���+�&����	���%�%�'�
�5�<�<�������X�.�
�8�"�"�6�;�7��<�
�1���"�"�$�m�4�
�1�=�=���� 6�7�
�6�+�+�2�2�A�6�
�6�)�)�0�0�!�4�
�1���"�"�A�&��*�F�,L�
�Jr!N)r5r6r7r�r�rmrprsr�r�r�rrrr#r*r.r4rDrLrTrWr`rfrirkrur{r r!r"r�r�s���������7��7�

&�'�RB�*+�89��-� �D%�(%�,"�*-:�^C�4�!�&6�@(�*(�	$�)�@9r!r�c��eZdZdZed��Zed��Zd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zd�Zd
�Zd�Zd�Zd�Zd�Zy)�KeysPageTestz�Test that keys tab widgets enable users to make changes.

    Test that widget actions set vars, that var changes add
    options to changes and that key sets works correctly.
    c��tjx}|_tjj	|�t�|_t�|_yr%)rr\rhrZr[r�
set_keys_type�load_keys_listrks  r"rmzKeysPageTest.setUpClasss8�� �/�/�)��s�x������4� �!�V���"�f��r!c�$�|j}|`|`yr%)rhrr�rks  r"rpzKeysPageTest.tearDownClasss���x�x����� 3r!c��|j}tjdd�D]$}tjdj	|��&tj�d|j_d|j_y)Nr�rr)
rhrr�rr�rr(rrQr�r�s   r"rszKeysPageTest.setUps`���I�I�� �.�.�v�v�>�G����V�$�3�3�G�<�?��
�
��!"�����"#����r!c���tj�|j}|j}t	j
d��t_|j�|j|jj��||jj�d�||jj�d�||jj�d�||j j"d�||j$j"d�||j$j&d�t
j(ddd	d
�t
j(dddd
�|j�||jj�d�||jj�d�||j j"d�||j$j"d�||j$j&d�t	j
d��t_t	j
d��t_t
j(dddd�|j�|j-|jj��||jj�d�||jj�d�||j j"d�||j$j"d�||j$j&d�t`t`tj.�y)N�IDLE Classic OSXr��- no custom keys -r�rM�r�rr�r�r�r�r�r�r�zIDLE Modern Unixr�Keysr�r�r�)r�)rr'rhrPrr<r�CurrentKeys�load_key_cfgr��
keyset_sourcer~r�r��custom_keyset_onr�rrQr��argsr��default_keysrr�r�s   r"�test_load_key_cfgzKeysPageTest.test_load_key_cfg!sg�������I�I��
�
�
�� $�y�y�6H�I���	����������+�+�-�.�
�1�>�>����!3�4�
�1�=�=���� 4�5�
�1���#�#�%�}�5�
�1�?�?�!�!�1�%�
�1���"�"�A�&�
�1��� � �"8�9�	���6�7�H�g�>����6�7�I�x�@�	����
�1�>�>����!3�4�
�1�=�=�����(�
�1�?�?�!�!�1�%�
�1���"�"�A�&�
�1��� � �"8�9� $�y�y�g�>��� $�	�	�7I� J������6�6�9�c�:�	����������,�,�.�/�
�1�>�>����!3�4�
�1�=�=�����(�
�1�?�?�!�!�1�%�
�1���"�"�A�&�
�1��� � �+�.�� �(�"7����r!c�|�|j}|j}t�|_t�|_|j
j
�|tdddii�||jjd�||jjd�tj�|jjd�|jj
�|jtdddii�||jjd�||jjd�|`|`y)Nr�r�r�rMrr�r�)
rPrhrr�r��builtin_keyset_onr?r�rQrr(r�r�r�s   r"�test_keyset_sourcezKeysPageTest.test_keyset_sourceKs���
�
�
���I�I��%)�V��"�$(�F��!�	���"�"�$�
�8�f�y�&�1�2�3�
�1�%�%�,�,�a�0�
�1�$�$�+�+�Q�/��
�
��	
��� � ��0�	���!�!�#�����F�Y��,@�#A�B�
�1�%�%�,�,�a�0�
�1�$�$�+�+�Q�/�
�&��(Ar!c���|j}|j}tjdj	d�gd�}|j
j
|d�|tdddd�i�||jdd�||jjd	�||jjd
�tj�tjdddd�|j
j
|d�|tdd
dii�||jdd�||jjd�||jjd
�tj�|j
j
|d�|tdddd�i�||jdd�||jjd�||jjd�y)Nrr�)�IDLE Classic Windowsr��IDLE Modern UNIXr�r�r�r�zNew key set, see HelprM)r�r�zIDLE Classic Unixr�r�r�rr�r�)rPrhrrr�r�r�r��keys_messager�rQr�rr(r�r�s    r"r�zKeysPageTest.test_builtin_name`s���
�
�
���I�I������ �/�/��7�)�	�	
�
�
���i�);�<�
�8�f�'=�(:�<�=�	>�
�1�>�>�&�!�#:�;�
�1���"�"�A�&�
�1��� � �"8�9�	�
�
�����6�6�6�3F�G�	�
�
���i�);�<�
�8�f�w�(:�;�<�=�
�1�>�>�&�!�#:�;�
�1���"�"�A�&�
�1��� � �"8�9�	�
�
��	�
�
���i�);�<�
�8�f�'9�B�G�H�I�
�1�>�>�&�!�2�&�
�1���"�"�A�&�
�1��� � �"8�9r!c��|j}|jjgd�|jdt�|j|jjd�tj�|jjgd�d�|jtdddii�|j|jjd�y)Nr�r�rrrr�rM)
rhrr�rr�rPr�rQrr(rRs  r"rzKeysPageTest.test_custom_name�s����I�I��	
�����R�!5�6������*�����)�)�0�0�!�4�	�
�
��	�����_�c�2�����F�V�S�M�#:�;�����)�)�0�0�!�4r!c���tjdddd�|j}|jj	d�|j
j
dd�|j
jdd�|j
jd	d
�|j
jd�|j
jd�|jj	d�|jtdddii�|j
jd	�|j
jd	�|jj	d�|jtdd
dii�y)
Nr�ZzDummy�enabler�zmy custom keysr�end�copyrMzz-in�	<Key-F11>�ZzDummy_cfgBindings)rr�rhr�ry�bindingslist�delete�insert�
selection_set�selection_anchor�
keybindingrPr\rFrRs  r"�test_keybindingzKeysPageTest.test_keybinding�s�����<��H�f�E��I�I��	�
�
���*�+�	�����a��'�	�����a��(�	�����a��(�	���$�$�Q�'�	���'�'��*�	������%�����*�V�[�,A�B�	D�	
���$�$�Q�'�	���'�'��*�	������%�����/�&�+�1F�G�	Ir!c��|j}|j}|`|jj	d�|j�||j
dt�||jdt�||jj�d�|jj	d�|j�||j
dt�||jj�d�||jdt�||jj�d�t�|_yr0)
rPrhrr�ryr�rrr
�button_delete_custom_keysr�r�rr�s   r"�test_set_keys_typezKeysPageTest.test_set_keys_type�s���
�
�
���I�I��
�O�	
�����D�!�	����
�1�=�=��!�6�*�
�1�<�<�� �(�+�
�1�&�&�,�,�.�
�>�	
�����E�"�	����
�1�=�=��!�8�,�
�1���#�#�%�}�5�
�1�<�<�� �&�)�
�1�&�&�,�,�.��3��&��r!c��|j}|j}tj}t	d��x}t_t	�x}|_|jjd�|jjdd�|jjdd�|jjd�|jjd�|jjd�|jjd�d|_|jj#�||jj%d	�d�||jj%�d�d
|_d|_|jj#�||j&d�||jj%d	�d�d|_|jj#�||j(j%�|j �||jj%d	�d
�||jj%�d
�|jjd�d|_d|_|jj#�||j&d�||jj%d	�d�||jj%�d�|`|t_y)NTrNr�rr�zcopy - <Control-Shift-Key-C>zKey-arr�r�rMzMy New Key Setzcopy - <Key-F11>Fz<Key-p>zcopy - <Key-p>)rPrhr�
GetKeysWindowr�get_new_keys_name�button_new_keysr�r�r�r�r�r�r�ryr�r=r?r~rQr�)r0r�rA�orig_getkeysdialog�gkd�gnkns      r"�test_get_new_keyszKeysPageTest.test_get_new_keys�sD��
�
�
���I�I��)�7�7��+/�D�+A�A��l�(�%)�V�+��q�"�	������/�	�����a��'�	�����a�!?�@�	���$�$�Q�'�	���'�'��*�	������!�	�����D�!���
�	��� � �"�
�1�>�>���h�'�)G�H�
�1�<�<����w�'�!��
����	��� � �"�
�4�;�;���
�1�>�>���h�'�)G�H�&���	��� � �"�
�1�=�=�������,�
�1�>�>���h�'�);�<�
�1�<�<����{�+�	
�����E�"������
�	��� � �"�
�4�;�;���
�1�>�>���h�'�)9�:�
�1�<�<����y�)�
��%7��"r!c���tj}td��x}t_|j}d|_|j|j
d�d�|t_y)NTrNzNew Keysr)rrPrrhr=rPr�rQs    r"�test_get_new_keys_namez#KeysPageTest.test_get_new_keys_name�sS��'�3�3��(,��(>�>��\�
%��I�I����	�����,�,�R�0�*�=�#3�� r!c��|j}t�x}|_|jj	d�d|_|jj�d|_d|_|j|j
tjd�|jj�|j|j
tjd�|`y)NTrzmy new key setrr)
rhrr�r�ryr=�button_save_custom_keysr?rQrrrr�)r0rAr�s   r"�test_save_as_new_key_setz%KeysPageTest.test_save_as_new_key_set�s����I�I��%)�V�+��q�"�	�����D�!����	�!�!�(�(�*�'������������h�&6�&6�v�&>�?�	�!�!�(�(�*��
�
�d�k�k�8�#3�#3�F�#;�<�
�r!c��|j}|j}|jdd�|jdd�|jdd�|j	d�|j�|j
d�|j�|jd�\}}}}||dzz
}||dzz
}|jddd��|jd	||��|jd
||��|jd||��|j|jd�d�|j|jj�d
�y)Nrr�r�rM�findr�rr�rr�r�r�r )rhr�r�r�rJr�r�rjr�r�rPr~r�r�)r0rArr�r�r�r�s       r"�test_on_bindingslist_selectz(KeysPageTest.test_on_bindingslist_selects!���I�I��
�N�N��	����E��	����F��	����F��	�
�
�1�
�	�
�
��	���a��	���
��v�v�a�y���1�b�"�	�R�1�W���	�R�1�W���	����a�1��-�	����q�A��.�	�����a��0�	���,��Q��7�������x��&�1�����*�*�0�0�2�B�7r!c�@�|j}|j}|jjd�|jjd�d}d}|j|tj�|j|�|t
jdd�|g�|t
jd�t
j|��||jj�|�|j|jj��||jjd�t!j"d|dd	�|j|tj�|j|�|t
jdd�||g�|j%t
j|�t
j|��t
j&d|dd	�|t
j|�t
j|��y)
NTr�zmy new custom key setzmy second custom keysetr�rrMr�r�)rPrhr�ryr�rrr�create_new_key_setr��	GetKeySetr�r~rrrQrr\r}r�r]s     r"�,test_create_new_key_set_and_save_new_key_setz9KeysPageTest.test_create_new_key_set_and_save_new_key_sets���
�
�
���I�I��	
�����D�!�	�����1�2�+�	�.�
�	
����H�$4�$4�5�	���Y�'�
�8�"�"�6�6�2�Y�K�@�
�8���4�5����i�(�	*�
�1�=�=����	�*�������,�,�.�/�
�1�?�?�!�!�1�%�	���6�9�f�k�B�����X�%5�%5�6�	���Z�(�
�8�"�"�6�6�2�Y�
�4K�L����H�.�.�y�9�$�.�.�z�:�	<�	���6�9�f�k�B�
�8���i�(�(�*<�*<�Z�*H�Ir!c��|j}|j}t�x}t_|`|j}|jdd�|jdd�|jdd�ddgdgd	gd
�|_	tjddd
d�d}|jd�||jdd�|�||jd�d�||j�d�|jd�|jd�|jd�||jdd�|�||jd�d�||j�d�|jd�|jd�|jd�||jdd�|�||jd�d�||j�d�t�|_t`y)Nrr�z<<find>>rMz<<help>>z<Control-Key-c>z<Control-Key-C>z<Control-Key-space>r�)z<<copy>>z<<force-open-completions>>z<<spam>>rzmy keysr�z
<Shift-Key-a>)z&copy - <Control-Key-c> <Control-Key-C>�,force-open-completions - <Control-Key-space>�spam - <Shift-Key-a>r�rr r�)rMr�r�)r�)rPrhrrr�r�r�r�r�r=rr\r~�curselectionr�r�)r0r�rA�gksrr�s      r"�test_load_keys_listz KeysPageTest.test_load_keys_list8s���
�
�
���I�I��#'�6�)��h� �
��
�N�N��	����E��	����J��	����J��#4�6G�"H�5J�4K�#.�-�1��
�	���6�9�f�o�F�,��
	
����#�
�1�5�5��E�?�H�%�
�1�5�5��?�B��
�1�>�>��R� �	
�����	���1��	����#�
�1�5�5��E�?�H�%�
�1�5�5��?�J�K�
�1�>�>��U�#�	
�����	���1��	����#�
�1�5�5��E�?�H�%�
�1�5�5��?�2�3�
�1�>�>��U�#��6����r!c�8�|j}|j}|jjd�t	�x}|_t	�t_t	�t_d}tjdj|dd�ddit|<d}tjdj|dd�dd	it|<|jjd�|jj�|jj!|�d
|_|jj�||j$d�|t|ddi�|tj&dd�||g�|tjj$d
�|tjj$d
�||j(j$d
�d|_|jj�||j$d�|j+|t�|tj&dd�|g�||jj�d�||jj-�|�|tjj$d�|tjj$d�||j(j$d�|jj!|�d|_|jj�||j$d�|j+|t�|tj&dd�g�||jj�d�||jj-�d�|tjj$d�|tjj$d�||j(j$d�t`t`|`y)Nr�zspam key setrr�r�r�r�z
other key setr�FrMr�rTr�r r�r�r�)rPrhr�r�rrwrrEr4rrr�r\r�r?r�ryr=rQr�rrr~)r0r�rArx�keyset_name�keyset_name2s      r"�test_delete_custom_keysz$KeysPageTest.test_delete_custom_keyscs&��
�
�
���I�I��	�#�#�)�)�.�9�!�V�#���
�+/�6��(�)-���&�$������ �*�*�;���H�!)�6� 2����&������ �*�*�<���I�"*�G�!4����	
��� � ��0�	���!�!�#�	�
�
���+�&����	�#�#�*�*�,�
�5�<�<���
�8�K� �8�V�"4�5�
�8�"�"�6�6�2�[�,�4O�P�
�6�+�+�2�2�A�6�
�6�)�)�0�0�!�4�
�1�?�?�!�!�1�%����	�#�#�*�*�,�
�5�<�<�������h�/�
�8�"�"�6�6�2�\�N�C�
�1���#�#�%�r�*�
�1�=�=�����-�
�6�+�+�2�2�A�6�
�6�)�)�0�0�!�4�
�1�?�?�!�!�1�%�	
�
�
���,�'����	�#�#�*�*�,�
�5�<�<�������h�/�
�8�"�"�6�6�2�B�7�
�1���#�#�%�}�5�
�1�=�=���� 4�5�
�6�+�+�2�2�A�6�
�6�)�)�0�0�!�4�
�1�?�?�!�!�1�%��*�F�,L�
�Jr!N)r5r6r7r�r�rmrprsr�r�r�rr�r�r�r�r�r�r�r�r�r r!r"r}r}s|����%��%��4��4�$�(�TB�*:�@5�I�*!�*.8�`4� �$8�*J�>)�V9r!r}c�V�eZdZdZed��Zd�Zd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zy)
�WinPageTestz�Test that general tab widgets enable users to make changes.

    Test that widget actions set vars, that var changes add
    options to changes.
    c��tjx}|_tjj	|�|j�yr%)r�winpagerhrZr[rjrks  r"rmzWinPageTest.setUpClass�s-�� �.�.�(��s�x������4� ����
r!c�,�tj�yr%rrr/s r"rszWinPageTest.setUp�rtr!c��|j}|j}|jjd�|jjd�|j
jd�|j
�||jj�d�||jj�d�||j
j�d�y)NrMr�80r�)rPrh�startup_editry�	win_width�
win_height�load_windows_cfgr~r�s   r"�test_load_windows_cfgz!WinPageTest.test_load_windows_cfg�s���
�
�
���I�I��	�����1��	�������	�������	����
�1�>�>�����#�
�1�;�;�?�?��d�#�
�1�<�<����t�$r!c��|j}|jj�|jtdddii�tj�|jj�|jtdddii�y)N�Generalzeditor-on-startuprwr�)rh�startup_editor_onr?rPr�rr(�startup_shell_onrRs  r"�test_startupzWinPageTest.test_startup�sv���I�I��	���"�"�$�����#�&9�3�%?�@�	B��
�
��	���!�!�#�����#�&9�3�%?�@�	Br!c��|j}|jjdd�|jjdd�|j	t
dddii�t
j�|jjdd�|jjdd�|j	t
dddii�y)Nrr��11r��height�width)	rh�win_height_intr�r�rPr�rr(�
win_width_intrRs  r"�test_editor_sizezWinPageTest.test_editor_size�s����I�I��	������5�)�	������4�(�����N�X�t�4D�#E�F��
�
��	�����q�%�(�	�����q�$�'�����N�W�d�O�#D�Er!c���|j}|jjd�|j|jj�d�|jtdddii�y)N��6�Indentz
num-spaces)rh�indent_chooserryrP�
indent_spacesr~r�rRs  r"�test_indent_spaceszWinPageTest.test_indent_spaces�sV���I�I��	�����Q��������,�,�.��4�����H�|�S�.A�#B�Cr!c��|jjj�|jtdddii�y)Nr�zcursor-blinkr�)rh�cursor_blink_boolr?rPr�r/s r"�test_cursor_blinkzWinPageTest.test_cursor_blink�s2���	�	�#�#�*�*�,�����N�^�W�4M�#N�Or!c���|jjjdd�|jjjdd�|j	t
dddii�y)Nrr�r��AutoComplete�	popupwait)rh�
auto_wait_intr�r�rPrFr/s r"�test_autocomplete_waitz"WinPageTest.test_autocomplete_wait�sP���	�	���&�&�q�%�0��	�	���&�&�q�$�/�����>�K��3F�"G�Hr!c���|j}|j}|jdjd�|tdddii�tj�|jjdd�|jjdd�|tdddii�tj�|jj�|tdd	d
ii�y)N�menur�
ParenMatchr6�openerr�r�zflash-delay�bellr�)rhrP�paren_style_typer?rFrr(�paren_flash_timer�r��bell_onr�s   r"�test_parenmatchzWinPageTest.test_parenmatch�s����I�I��
�
�
��	���6�"�)�)�!�,�
�7�\�G�X�#6�7�8��
�
��	���!�!�!�U�+�	���!�!�!�T�*�
�7�\�M�4�#8�9�:��
�
��	�	�	����
�7�\�F�G�#4�5�6r!c���|jjjdd�|jjjdd�|j	t
dddii�y)Nrr�r��FormatParagraphz	max-width)rh�format_width_intr�r�rPrFr/s r"�test_paragraphzWinPageTest.test_paragraph�sQ���	�	�"�"�)�)�!�U�3��	�	�"�"�)�)�!�T�2�����#4�{�D�6I�"J�Kr!N)r5r6r7r�r�rmrsr�r�r�r�r�r�r�r�r r!r"r�r��sN���
����
�
%�B�F�D�P�I�
7�Lr!r�c�8�eZdZdZed��Zd�Zd�Zd�Zd�Z	y)�ShedPageTestz�Test that shed tab widgets enable users to make changes.

    Test that widget actions set vars, that var changes add
    options to changes.
    c��tjx}|_tjj	|�|j�yr%)r�shedpagerhrZr[rjrks  r"rmzShedPageTest.setUpClass�s-�� �/�/�)��s�x������4� ����
r!c�,�tj�yr%rrr/s r"rszShedPageTest.setUp�rtr!c���|j}|j}|jjd�|j	�||jj�d�y)NrMr)rPrh�autosavery�load_shelled_cfgr~r�s   r"�test_load_shelled_cfgz"ShedPageTest.test_load_shelled_cfg�sG��
�
�
���I�I��	�
�
���q��	����
�1�:�:�>�>��Q�r!c���|j}|jj�|jtdddii�|j
j�|jtdddii�y)Nr�rrwr�)rh�save_auto_onr?rPr��save_ask_onrRs  r"�
test_autosavezShedPageTest.test_autosaves_���I�I��	����������I�
�C�/@�#A�B�	�
�
��������I�
�C�/@�#A�Br!c���|jjjdd�|jjjdd�|j	t
dddii�y)Nrr�rw�CodeContext�maxlines)rh�context_intr�r�rPrFr/s r"�test_contextzShedPageTest.test_contextsP���	�	���$�$�Q��.��	�	���$�$�Q��,�����=�:�s�2C�"D�Er!N)
r5r6r7r�r�rmrsrrrr r!r"r�r��s1���
����
� �C�Fr!r�c� �eZdZdZed��Zy)�ExtPageTest�/Test that the help source list works correctly.c�b�tj}tjj|�yr%)rrFrZr[rks  r"rmzExtPageTest.setUpClasss���~�~�������4� r!N)r5r6r7r�r�rmr r!r"r
r
s��9��!��!r!r
c�`�eZdZdZed��Zed��Zd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zy)
�HelpSourceTestrc��tj}tjj|�|jx}|_t
�x|_|_t
�x|_	|_
|j�yr%)rrFrZr[�
frame_help�framerry�set_add_delete_state�upc�update_help_changesrj)rlrhrs   r"rmzHelpSourceTest.setUpClasssX���~�~�������4� � �O�O�+���	�15��7��	�E�.�04��6��	�E�-�
���r!c��|j}|`|`|`|`|j
j
dd�|jj�y)Nrr�)	rryrrr�helplistr��
user_helplistr()rlrs  r"rpzHelpSourceTest.tearDownClass(sE���	�	���I�u�1��I�u�0�
�����a��'�
���!�!�#r!c�,�tj�yr%rrr/s r"rszHelpSourceTest.setUp0rtr!c�<�|j}|j}|jjdd�ddg|_tjdddd�|j�||jjdd�d	�||jd
g�y)Nr��bad�worser�	HelpFilesrwz	name;filer)r�)r��filerw)	rPrrr�rrr��
load_helplistr~�r0r��frs   r"�test_load_helplistz!HelpSourceTest.test_load_helplist3s���
�
�
��
�Z�Z��
�����5�%�(�!�7�+������6�;��[�A�
����
�2�;�;�?�?�1�e�$�i�0�
�2���3�4�5r!c�*�|j}|j|_|j|_|j
}d}|j
|d�|j|�|j�|j|�|j�|j|�\}}}}||dzz
}||dzz
}dx|j_|j_|jddd��|jd||��|jd||��|jd	||��|j|jd
�d�|j!|jj�|j#|jj�y)Nr��sourcer�rrr�rr�r�r�)rrryrrrr�rJr�r�rjr�rQr�rPr~r�r)r0r#r�dexr�r�r�r�s        r"�test_source_selectedz#HelpSourceTest.test_source_selected=sO��
�Z�Z���(�(����'�'����;�;��������X�&����#���������S�������}�}�S�)���1�b�"�	�R�1�W���	�R�1�W���()�)����
����
����	�Q�!��4����
�a�1��5������Q��7���� 3�q�A��>�������h�/��:�������
�
�&���������'r!c��|j}|j}|`|j}|j}|j	dd�|�||j
j
�d�||jj
�d�|jdd�|�||j
j
�d�||jj
�d�|jd�|�||j
j
�d�||jj
�d�t�|_y)Nrr�r�r&r )rPrrrr��button_helplist_editr��button_helplist_remover�r�r)r0r�r#�sad�hs     r"�test_set_add_delete_statez(HelpSourceTest.test_set_add_delete_stateUs��
�
�
��
�Z�Z���#��%�%���K�K��	����E����
�2�"�"�(�(�*�M�:�
�2�$�$�*�*�,�m�<�	����H����
�2�"�"�(�(�*�M�:�
�2�$�$�*�*�,�m�<�	�������
�2�"�"�(�(�*�B�/�
�2�$�$�*�*�,�b�1�"&�&��r!c��|j}tj}td��x}t_|j}|j
j
dd�|jj�dx|j_
|j_
d|_|j�|jt|j
j!dd��|jcxk(xrgk(nc�|j#|jj�d|_|j�d|_|j�||j
j!dd�d�||jddg�||jjd	�|j#|jj�|t_y)
NTrNrr�r��name1�file1�r��file2)r1r�r�)rPr�
HelpSourcerrrr�rr(ryrQrr=�helplist_item_addr��listr~r�r0r��orig_helpsourcerr#s     r"�test_helplist_item_addz%HelpSourceTest.test_helplist_item_addmsY���
�
��&�1�1��'+��'=�=��\�
$�
�Z�Z��
�����1�e�$�
����� �()�)����
����
���	�
��������R�[�[�_�_�Q��6�7��(�(�/�,.�/�	0���������'�&��	�
����&��	�
����
�2�;�;�?�?�1�e�$�&8�9�
�2���0�2D�E�F�
�2�6�6�=�=�!����������'�"1��r!c�`�|j}tj}td��x}t_|j}|j
j
dd�|j
jdd�|j
jd�|j
jd�|jj�|jjd�dx|j_|j_d|_|j#�d|_|j#�||j
j%dd�d�||jdg�|j'|jj�d	|_|j#�||j
j%dd�d
�||jd	g�|j)|jj|jjcxk(xrdk(nc�|t_y)NTrNrr�r1r0r)r1r3)r�rM)rPrr5rrrr�r�r�r�rr(�appendryrQrr=�helplist_item_editr~rr�r8s     r"�test_helplist_item_editz&HelpSourceTest.test_helplist_item_edit�s���
�
�
��&�1�1��'+��'=�=��\�
$�
�Z�Z��
�����1�e�$�
�����1�g�&�
���!�!�!�$�
���$�$�Q�'�
����� �
����� 2�3�()�)����
����
���	�
����&��	�
����
�2�;�;�?�?�1�e�$�j�1�
�2���0�1�2���������'�&��	�
����
�2�;�;�?�?�1�e�$�j�1�
�2���0�1�2�������
�
������;�!�;�<�"1��r!c���|j}|j}|jjdd�|jj	dd�|jjd�|jj
d�|jj�|jjd�dx|j_|j_|j�||jjdd�d�||jg�|j|jj|jjcxk(xr
dk(�yc�y)Nrr�r1r0r rM)rPrrr�r�r�r�rr(r<ryrQr�helplist_item_remover~r�r"s   r"�test_helplist_item_removez(HelpSourceTest.test_helplist_item_remove�s��
�
�
��
�Z�Z��
�����1�e�$�
�����1�g�&�
���!�!�!�$�
���$�$�Q�'�
����� �
����� 2�3�()�)����
����
�
���!�
�2�;�;�?�?�1�e�$�b�)�
�2���R� �������
�
������;�!�;�<�;�<r!c�6�|j}|`|jj�|jj	d�|jj	d�|j�|jtdddd��t�|_y)Nr0r3rzname1;file1zname2;file2)rw�2)rrrr(r<rPr�r)r0r#s  r"�test_update_help_changesz'HelpSourceTest.test_update_help_changes�s���
�Z�Z���"�
����� �
����� 2�3�
����� 2�3�
��� �����+�.�,�=�A�	C�!%���r!N)r5r6r7r�r�rmrprsr$r(r.r:r>rArDr r!r"rrsS��9������$��$��6�(�0)�02�82�<=� 
(r!rc�\�eZdZed��Zed��Zd�Zd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
y)�VarTraceTestc��tj�|_tt�|_t
t�|_yr%)r�VarTracerrr�ivr�bvros r"rmzVarTraceTest.setUpClass�s)��"�+�+�-���������D�!��r!c��|`|`|`yr%)rrIrJros r"rpzVarTraceTest.tearDownClass�s���K����r!c�F�|jj�d|_y)Nr)rr(rQr/s r"rszVarTraceTest.setUp�s����������r!c�.�|xjdz
c_y)N�
)rQ�r0�paramss  r"�var_changed_incrementz"VarTraceTest.var_changed_increment�s�����r��r!c��yr%r rOs  r"�var_changed_booleanz VarTraceTest.var_changed_boolean�r2r!c��|j}|j�|j|jg�|j|jg�yr%)r�__init__rP�untraced�traced�r0�trs  r"�	test_initzVarTraceTest.test_init�s<��
�\�\��
���
�������b�)�������B�'r!c��|j}|jjd�|jjd�|j	�|j|jg�|j|jg�y)NrrM)rrVr<rWr(rPrXs  r"�
test_clearzVarTraceTest.test_clear�s`��
�\�\��
�����1��
�	�	�����
���
�������b�)�������B�'r!c���|j}t�}tj|��x}|_|j|j|j�}|j||j�|j|j|j�}|j||j�tt�}|j|d�}|j||�|j�|j|d�||jf||jf||fg}|j|j g�|j|j"|�|`y)Nr��rr�r�)rrrr<�
make_callback�addrIrQ�assertIsrJrSr
rr@�assert_called_withrPrWrV)	r0rY�func�cbrIrJ�sv�sv2r�s	         r"�test_addzVarTraceTest.test_add�s��
�\�\���v�� $�	�	�t� <�<��R�
�
�V�V�D�G�G�T�7�7�
8���
�
�b�$�'�'�"�
�V�V�D�G�G�T�5�5�
6���
�
�b�$�'�'�"�
�t�_���f�f�R�6�7���
�
�c�2��
����
���b�"?�@���3�3�4���1�1�2���J� ��	
������B�'�������h�/��r!c��|jj|jd�}|jt	|��|jjd�|j
dtd�|�|jdtd�|jtdddd�tj�y)Nr^�*r�rr��42)rr_rIr��callableryrrr�rPr()r0rds  r"�test_make_callbackzVarTraceTest.test_make_callbacks���
�\�\�
'�
'����1N�
O��������%������B������G�F�O�4�
���
�
�i����1��������3�H�=�t�D��
�
�r!c��|j}|j|j|j�}|j|j|j
�}||jf||j
fg}|j
�|j|jg�|j|j|�|jd�|j|j�d�|j|jd�d|_
|j
�|jd�|j|jd�d|_
|j�|j|jg�|j|j|�|jd�|j|jd�y)NrMrNr)rr`rIrQrJrSr�rPrV�assertCountEqualrWryr~rQr')r0rYrIrJr�s     r"�test_attach_detachzVarTraceTest.test_attach_detachsT��
�\�\��
�V�V�D�G�G�T�7�7�
8��
�V�V�D�G�G�T�5�5�
6����3�3�4���1�1�2�4��	�	�	��������b�)����b�i�i��2�
���q�	��������1�%�������b�)�
���
�	�	��
���q�	�������b�)����
�	�	��������B�'����b�k�k�8�4�
���q�	�������a�(r!N)r5r6r7r�rmrprsrQrSrZr\rgrlror r!r"rFrF�sP���"��"�
�(��(���
�(�(��0
�)r!rF�__main__r�)�	verbosity)0r��idlelibr�test.supportr�test.support.testcaser�unittestr�idlelib.idle_test.mock_idler�tkinterr	r
rrr
rr�idlelib.configdialogrrrrr&�IdleUserConfParserrrrr�r�r\rFr#r+�TestCaser-r9rer�r}r�r�r
rrFr5rr r!r"�<module>r{s����!�!����1���,�I�I��;�;�
�
�
��%�F�%�%�b�)�*��*�*�2�.�%�F�%�%�b�)�+�&�+�+�B�/�	����	
���6�?���;����6�?��
�,�
��B��
�x�(�(�
�(<��"�"�O�(<�V[�8�$�$�[�|y�8�$�$�y�xX�8�$�$�X�vNL�(�#�#�NL�b!F�8�$�$�!F�J!�(�#�#�!�d(�X�&�&�d(�Ne)�8�$�$�e)�P�z���H�M�M�A��r!

Youez - 2016 - github.com/yon3zu
LinuXploit