
    z%i0                     F   	 d dl mZ d dlmZ  ed       d dlZd dlmZ d dlmZ d dlm	Z	m
Z
mZmZmZmZ d dl mZ d d	lmZmZmZ ej(                  Z ej,                  d
       ej,                  d
       ej,                  d
       ej,                  d
      dZdadaed   Zed   Zed   Zed   Zd Zd Z G d dej@                        Z! G d dej@                        Z" G d dej@                        Z# G d dej@                        Z$ G d dej@                        Z% G d dej@                        Z& G d dej@                        Z' G d  d!ej@                        Z( G d" d#ej@                        Z) G d$ d%ej@                        Z*e+d&k(  r ejX                  d'(       yy))    )configdialog)requiresguiN)mock)Func)Tk	StringVarIntVar
BooleanVarDISABLEDNORMAL)config)idleConfchangestracers )main	highlightkeys
extensionsr   r   r   r   c                  n    t         t        _        t               at        j                  t        dd      ay )NTestT)_utest)testcfgr   userCfgr   rootr   ConfigDialogdialog     W/home/uftp/.pyenv/versions/3.12.0/lib/python3.12/idlelib/idle_test/test_configdialog.pysetUpModuler"   "   s%    H4D&&tVDAFr    c                      t         t        _        t        j                          t        j
                          t        j
                          t        j                          t        j                          d xaa
y N)usercfgr   r   r   detachclearr   r   update_idletasksdestroyr   r   r    r!   tearDownModuler*   *   sE    HNNMMOMMOLLND6r    c                       e Zd Zd Zd Zy)ConfigDialogTestc                      y r$   r   selfs    r!   test_deactivate_current_configz/ConfigDialogTest.test_deactivate_current_config7       r    c                      y r$   r   r.   s    r!   activate_config_changesz(ConfigDialogTest.activate_config_changes:   r1   r    N)__name__
__module____qualname__r0   r3   r   r    r!   r,   r,   5   s    r    r,   c                   $    e Zd Zd Zd Zd Zd Zy)
ButtonTestc                     t         }t        j                         x}|_        t        j                         x}|_        |j
                  d   j                          |j                          |j                          |`|`y )NOk)r   r   Mockapplyr)   buttonsinvokeassert_called_once)r/   dr<   r)   s       r!   test_click_okzButtonTest.test_click_ok@   s`    ))+%"iik)!)			$   """$Iqwr    c                    t         }t        j                         x}|_        t        j                         x}|j                  _        t        j                         x}|_        |j                  d   j                          |j                          |j                          |j                          |j                  `|`|`y )NApply)
r   r   r;   deactivate_current_configextpagesave_all_changed_extensionsr3   r=   r>   r?   )r/   r@   
deactivatesave_extactivates        r!   test_click_applyzButtonTest.test_click_applyI   s    3799;>
Q0;?99;F1998/3yy{:1,			'!!#%%'##%##%II1%q'Br    c                    t         }t               |_        dt        d   d<   |j                  d   j                          | j                  t        d   i        | j                  |j                  j                  d       |`y )N   r   	somethingCancel)r   r   r)   r   r=   r>   assertEqualcalledr/   r@   s     r!   test_click_cancelzButtonTest.test_click_cancelU   sf    F	'($			(""$"-))1-Ir    c                    t         j                  j                  t         j                         t        j
                  j                  t        dt              5 }t         j                  d   j                          |j                  d   |j                  d   }}d d d        | j                  d       | j                  j                  d      xr |j                  d             y # 1 sw Y   OxY w)	N	view_text)new_callableHelptitlecontentszHelp for IDLE preferenceszWhen you clickza different name.
)r   noteselectkeyspager   patchobjectr   r   r=   r>   kwdsrO   
assertTrue
startswithendswith)r/   viewrW   rX   s       r!   test_click_helpzButtonTest.test_click_help^   s    6??+ZZ|[,0  2 	H59NN6"))+"ii0$))J2G8E	H 	 ;<++,<= A ))*?@	B	H 	Hs   A C&&C/N)r4   r5   r6   rA   rJ   rR   rc   r   r    r!   r8   r8   >   s    
CBr    r8   c                   ^    e Zd Z	 ed        Zed        Zd Zd Zd Zd Z	d Z
d Zd	 Zd
 Zy)FontPageTestc                     t         j                  x}| _        t         j                  j	                  |       t               |_        |j                          y r$   )r   fontpagepagerY   rZ   r   set_samplesupdateclsrh   s     r!   
setUpClasszFontPageTest.setUpClassp   s7     //)sx4 6r    c                     | j                   `y r$   )rh   ri   rl   s    r!   tearDownClasszFontPageTest.tearDownClassw   s    HH r    c                 ,    t        j                          y r$   r   r'   r.   s    r!   setUpzFontPageTest.setUp{       r    c                    t        j                          | j                  }|j                  j	                  d       |j
                  j	                  d       |j                  j	                  d       d|j                  _        |j                          | j                  |j                  j                         d       | j                  |j
                  j                         d       | j                  |j                  j                                | j                  |j                  j                  d       t        j                          y )NFake1Tr   rL   )r   r&   rh   	font_nameset	font_size	font_boldri   rP   load_font_cfgassertNotEqualgetassertFalserO   attachrQ   s     r!   test_load_font_cfgzFontPageTest.test_load_font_cfg~   s     	II			 	AKKOO-v6AKKOO-s3*+--q1r    c                 \   | j                   }|j                  j                         dk  r| j                  d       |j                  }|j	                  d       |j                  j                  d      }|j                          |j                          |j                  d       |j                  d       |j                  d      }| j                  ||       | j                  |j                  j                         |j                                |j                          |j                          |j                  d       |j                  d       |j                  d      }| j                  ||       | j                  |j                  j                         |j                                y )	N   need at least 2 fontsr   activez
<Key-Down>z<KeyRelease-Down>z<Key-Up>z<KeyRelease-Up>)rh   fontlistsizeskipTestrI   r~   focus_forcerj   event_generater}   assertInrx   lowerrO   )r/   r@   r   font	down_fontup_fonts         r!   test_fontlist_keyzFontPageTest.test_fontlist_key   s9   II::??q MM12::!zz~~h' 	- 34LL*	It,akkoo'):; 	
+ 12,,x($'akkoo'9r    c                    | j                   }|j                  j                         dk  r| j                  d       |j                  }|j	                  d       |j                          |j                  d       |j                          |j                  d      \  }}}}||dz  z  }||dz  z  }|j                  d||       |j                  d||       |j                  d      }|j                  d      }| j                  ||       | j                  |j                  j                         |j                                y )	Nr   r   r   rL   
<Button-1>xy<ButtonRelease-1>anchor)rh   r   r   r   rI   r   seerj   bboxr   r~   rO   r   rx   r   )	r/   r@   r   r   r   dxdyfont1select_fonts	            r!   test_fontlist_mousez FontPageTest.test_fontlist_mouse   s
   II::??q MM12::! 	Q}}Q'1b"	R1W	R1WQ7 3qA>Qll8,e,akkoo'7r    c                     | j                   }|j                  j                  j                  d       | j	                  |j
                  j                         d       y )N(   40)rh   sizelistvariablery   rO   rz   r~   rQ   s     r!   test_sizelistzFontPageTest.test_sizelist   s>    II	

#*D1r    c                 ^   | j                   }|j                  j                  d       |j                  j	                          | j                  |j                  j                                |j                  j	                          | j                  |j                  j                                y )NF)rh   r{   ry   bold_toggler>   r_   r~   r   rQ   s     r!   test_bold_togglezFontPageTest.test_bold_toggle   sk    II		)*	*+r    c                    t        j                  t        dd      }t        |d         }|d   dk(  }| j                  }|j
                  j                  |       |j                  j                  |       d|j                  _	        |j                  j                  d       dd|t        |      di}| j                  t        |       | j                  |j                  j                  d       t        j                          |j
                  j                  d	       ddd	t        |      di}| j                  t        |       | j                  |j                  j                  d       t        j                          |j                  j                  |        ddd	t        |       di}| j                  t        |       | j                  |j                  j                  d
       y )Nr   EditorWindowrL   r   boldr   z	Test Font)r   z	font-sizez	font-bold20   )r   GetFontr   strrh   rz   ry   r{   ri   rP   rx   rO   mainpager   r'   )r/   default_fontdefault_sizedefault_boldr@   expecteds         r!   test_font_setzFontPageTest.test_font_set   s   
  ''fnE<?+#A&0II	%	% 	$"[2>25l2C%E F 	8,--q1	"[2625l2C%E F 	8,--q1	L()"[2625,6F2G%I J 	8,--q1r    c                    | j                   }|`|j                  |j                  f}i i c|_        |_        |j                  j                  d       |j                  j                  d       |j                  j                  d       ddi}|j                          | j                  |j                  |j                  cxk(  xr |k(  nc        |\  |_        |_        t               |_        y )Ntest5rL   r   )r   r   r   )
rh   ri   font_samplehighlight_samplerx   ry   rz   r{   r_   r   )r/   r@   orig_samplesr   s       r!   test_set_sampleszFontPageTest.test_set_samples   s    IIM}}a&8&88,.)q)			12 	
););GxGH,8)q)r    N)r4   r5   r6   classmethodrm   rp   rs   r   r   r   r   r   r   r   r   r    r!   re   re   i   sX       ! ! ::8.2,"2Hr    re   c                       e Zd Z	 ed        Zed        Zd Zd Zd Zd Z	d Z
d Zd	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zy)HighPageTestc                    t         j                  x}| _        t         j                  j	                  |       t               |_        t               |_        t               |_        t               |_	        |j                          y r$   )r   highpagerh   rY   rZ   r   set_theme_typepaint_theme_sampleset_highlight_targetset_color_samplerj   rk   s     r!   rm   zHighPageTest.setUpClass  sU     //)sx4 "f"&&$(F! $r    c                 ,    | j                   }|`|`|`|`y r$   )rh   r   r   r   r   )rl   r@   s     r!   rp   zHighPageTest.tearDownClass  s!    HHa2"A$6r    c                 F   | j                   }t        j                  dd      D ]$  }t        j                  d   j	                  |       & t        j                          d|j                  _        d|j                  _        d|j                  _        d|j                  _        y )Nuserr   r   )rh   r   GetSectionListr   remove_sectionr   r'   r   rP   r   r   r   r/   r@   sections      r!   rs   zHighPageTest.setUp  s    II  ..v{C 	BG[)88A	B"#&'#()%$%!r    c                 x   t        j                          | j                  }| j                  }t	        j
                  d      t        _        |j                          | j                  |j                  j                                 ||j                  j                         d        ||j                  j                         d        ||j                  j                         d        ||j                   j"                  d        ||j$                  j"                  d        ||j&                  j"                  d       t        j(                  dddd	       t        j(                  dd
dd       |j                           ||j                  j                         d        ||j                  j                         d        ||j                   j"                  d        ||j$                  j"                  d        ||j&                  j"                  d       t	        j
                  d
      t        _        t        j(                  dddd       |j                          | j+                  |j                  j                                 ||j                  j                         d        ||j                  j                         d
        ||j                   j"                  d        ||j$                  j"                  d        ||j&                  j"                  d       t        `t        j,                          y )NIDLE Classicreturn_value- no custom themes -disabledrL   r   test1optionvaluetest2option2value2r   r   Themedefault0r   )r   r&   rh   rO   r   r;   r   CurrentThemeload_theme_cfgr_   theme_sourcer~   builtin_namecustom_namecustom_theme_onstater   rP   r   r   	SetOptionr   r   r/   r@   eqs      r!   test_load_theme_cfgz HighPageTest.test_load_theme_cfg*  sV   II !%		~ 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 ?67Is;	++-.
1>>0
1==(
1""A&
1&&*
1!!((!,!r    c                 |   | j                   }| j                  }t               |_        t               |_        |j
                  j                           |t        dddii        ||j                  j                  d        ||j                  j                  d       t        j                          |j                  j                  d       |j                  j                          | j                  t        dddii        ||j                  j                  d        ||j                  j                  d       |`|`y )Nr   r   TruerL   r   z	!disabledFalse)rO   rh   r   var_changed_builtin_namevar_changed_custom_namebuiltin_theme_onr>   r   rP   r   r'   r   r   r/   r   r@   s      r!   test_theme_sourcezHighPageTest.test_theme_sourceS  s    II%)V"$(F!	!!#
8g	6234
1%%,,a0
1$$++Q/ 	
/	  "Gi-A#BC
1%%,,a0
1$$++Q/&(Ar    c                 0   | j                   }| j                  }g d}t        j                  dddd       |j                  j                  |d        |t        ddddi        ||j                  d	   d
        ||j                  j                  d       t        j                          t        j                  dddd       |j                  j                  |d        |t        dddii        ||j                  d	   d
        ||j                  j                  d       t        j                          |j                  j                  |d        |t        ddddi        ||j                  d	   d        ||j                  j                  d       y )N)r   	IDLE DarkIDLE Newr   r   namespamr   r   r   name2textzNew theme, see HelprL   r   r   r   r   r   )rO   rh   r   r   builtinlistSetMenur   theme_messager   rP   r   r'   r/   r   r@   	item_lists       r!   test_builtin_namezHighPageTest.test_builtin_nameh  sW   II=	 	67FF;	i5
8g)4 6 7 	8
1??6"$9:
1&&* 	67FJ?	i5
8g567
1??6"$9:
1&&* 		i8
8gDEF
1??6"B'
1&&*r    c                    | j                   }|j                  j                  g d       | j                  dt               | j                  |j                  j                  d       t        j                          |j                  j                  g dd       | j                  t        dddii       | j                  |j                  j                  d       y )Nr   r   r   abcr  r   rL   )
rh   
customlistr   assertNotInr   rO   r   rP   r   r'   rQ   s     r!   test_custom_namezHighPageTest.test_custom_name  s    II 	
R!78(+--44a8 		_c2Gfc]#;<--44a8r    c                     | j                   }t               |_        |j                  j	                  d       | j                  |j                  j                  d       |`y )NgreenrL   )rh   r   on_new_color_setcolorry   rO   rP   rQ   s     r!   
test_colorzHighPageTest.test_color  sG    II!V	G++22A6r    c                     | j                   }| j                  }|j                  j                  g dd        ||j                  j                         d        ||j                  j                  d       y )Nr   r  rL   )rO   rh   
targetlistr   highlight_targetr~   r   rP   r   s      r!    test_highlight_target_list_mousez-HighPageTest.test_highlight_target_list_mouse  sY    II	_c2
1!!#S)
1!!((!,r    c                   	 | j                   }| j                  i }d}j                  		j                          	j	                  d       	j                          fd}	fd} ||       	j                         D ]l  }	j                  |      dd d   D ]P  }|dz  } ||        |j                  j                         ||           |j                  j                  |       R n y )Nr         ?c                 Z    j                   j                         D ]  \  }}|| |d   <    y Nr   )theme_elementsitems)elemelementtagr@   s      r!   tag_to_elementzEHighPageTest.test_highlight_target_text_mouse.<locals>.tag_to_element  s2     ! 0 0 6 6 8 '&SV'r    c                     j                  |       \  }}}}||dz  z  }||dz  z  }j                  ddd       j                  d||       j                  d||       j                  d||       y )Nr   <Enter>r   r   <Motion><ButtonPress-1>r   )r   r   )startr   r   r   r   hss        r!   click_itz?HighPageTest.test_highlight_target_text_mouse.<locals>.click_it  s    775>LAq"bqLAqLAi12jA3/1:1Q!<r    r   rL   )rO   rh   r   r   r   r(   	tag_names
tag_rangesr  r~   r   rP   )
r/   r   r  countr  r  r  start_indexr@   r  s
           @@r!    test_highlight_target_text_mousez-HighPageTest.test_highlight_target_text_mouse  s    II

s
	'	= 	t <<> 	9C!}}S1!$Q$7 9
%1%%))+T#Y71))00%8	9	9r    c                    | j                   }| j                  }|j                  }|j                          |j	                  d       |j                          |j                  ddd       |j                  ddd       t        d      D ]*  }|j                  ddd       |j                  ddd       ,  ||j                  d	      d
       y )Nr  r  r   r   r  r   r  r   selr   )	rO   rh   r   r   r   r(   r   ranger!  )r/   r   r@   r  _s        r!   "test_highlight_sample_double_clickz/HighPageTest.test_highlight_sample_double_click  s    II

s
 	)qA.
*Q/q 	=A/1:1Q!<	= 	2==$r    c                    | j                   }| j                  }|j                  }|j                          |j	                  d       |j                          |j                  d      \  }}}}}|j                  d       |j                  d       |j                  d||       |j                  d||       |j                  d||       |j                  d	||        ||j                  d
      d       y )Nr  z1.0z<Leave>r  r  r   r  z<B1-Motion>r   r&  r   )	rO   rh   r   r   r   r(   	dlineinfor   r!  )	r/   r   r@   r  r   r   r   r   offsets	            r!   test_highlight_sample_b1_motionz,HighPageTest.test_highlight_sample_b1_motion  s    II

s
!||E21b"f 	)$
)$
*Q/
+qA6
-24
-r:
2==$r    c                    | j                   }| j                  }|`|j                  j	                  d       |j                           ||j
                  d   t                ||j                  d   t                ||j                  j                         d       |j                  j	                  d       |j                           ||j
                  d   t                ||j                  j                         d        ||j                  d   t                ||j                  j                         d       t               |_        y NTr   r   Fselectedr   )rO   rh   r   r   ry   r   r   r  r   button_delete_customr   r   r   r   s      r!   test_set_theme_typez HighPageTest.test_set_theme_type  s    II 	
4 	
1==!6*
1<< (+
1!!'')=9 	
5!	
1==!8,
1""$m4
1<< &)
1!!'')2.6r    c                    | j                   }| j                  }t        j                  j                  }t               x}t        j                  _        t               x}|_        |j                  j                  d       |j                  j                  d       d|_
        |j                  j                           ||j                  j                         d       d|j                  j                  |j                   d   d      f|_
        |j                  j                           ||j                  j                         d       d|_
        |j                  j                  d       |j"                  j                  d       d|_
        |j                  j                           ||j$                  d	        ||j                  j                         d       d
|_
        |j                  j                           ||j&                  j                         |j                          ||j                  j                         d       |j                  j                  d       |j"                  j                  d       |j                  j                           ||j                  j                         d       |`|t        j                  _        y )NzEditor Breakpointz#ffffff)NNr   style
background))g    k@        r7  #de0000TrL   zMy New Themer8  F)rO   rh   r   colorchooseraskcolorr   get_new_theme_namer  ry   r	  resultbutton_set_colorr>   r~   r5  lookupframe_color_setr   rP   r   )r/   r   r@   orig_chooserchoosergntns         r!   test_get_colorzHighPageTest.test_get_color  s   II#00997;v=,++4&*f,q#	23	I &	!!#
177;;=)$ aggnnQ->->w-GVW	!!#
177;;=)$ > 	
I	4  	!!#
4;;
177;;=)$$	!!#
1==,
177;;=)$ 	
I	5!	!!#
177;;=)$ -9!!*r    c                    | j                   }d}|j                  j                  d       |j                  j                  d       |j                  j                  d       |j
                  j                  |       | j                  |j                  j                  |j                  d   d      |       | j                  |j                  j                  dd      |       | j                  t        dd	|ii       y )
Nz#3f7caePythonSelected TextTr5  r6  hilite
foregroundzhilite-foreground)rh   r   ry   r  fg_bg_toggler	  rO   r5  r>  r?  r   tag_cgetr   )r/   r@   r	  s      r!   test_on_new_color_setz"HighPageTest.test_on_new_color_set6  s    II	(#	/	4 	E(9(9'(BLQSXY++44X|LeT"%8%$@A	Cr    c                     t         j                  }t        d      x}t         _        | j                  }d|_        | j                  |j                  d      d       |t         _        y )NTreturn_selfz	New Themer   )r   SectionNamer   rh   r<  rO   r;  r/   orig_sectionnamesnr@   s       r!   test_get_new_theme_namez$HighPageTest.test_get_new_theme_nameC  sS    '33(,(>>\%II	--b1;?#3 r    c                    | j                   }t               x}|_        |j                  j	                  d       d|_        |j                  j                          | j                  |j
                  t        j                  d          d|_        d|_        | j                  |j
                  t        j                  d          |j                  j                          | j                  |j
                  t        j                  d          |`y )NTr   r   zmy new themer   )rh   r   r;  r   ry   r<  button_save_customr>   r  r   r   rP   r   )r/   r@   rB  s      r!   test_save_as_new_themez#HighPageTest.test_save_as_new_themeM  s    II&*f,q#	4  	##%h&6&6{&CD %h&6&6{&CD	##%dkk8#3#3K#@A r    c                 L   | j                   }| j                  }|j                  j                  d       |j                  j                  d       d}d}| j                  |t        j                         |j                  |        |t        j                  dd      |g        |t        j                  dd      t        j                  d|              ||j                  j                         |       | j                  |j                  j                                 ||j                  j                  d       t!        j"                  d|d	d
       | j                  |t        j                         |j                  |        |t        j                  dd      ||g       | j%                  t        j                  d|      t        j                  d|             t        j&                  d|d	d
        |t        j                  d|      t        j                  d|             y )NTr   zmy new custom themezmy second custom themer   r   r   rL   zhit-backgroundyellow)rO   rh   r   ry   r   r  r   r   
create_newr   GetThemeDictr   r~   r   r   rP   r   
add_optionr}   r   r/   r   r@   	first_new
second_news        r!   test_create_new_and_save_newz)HighPageTest.test_create_new_and_save_new`  s   II 	
4 	>*)	-
 	H$4$45	Y
8""6;7)E
8  N;  3	5
1==	*++-.
1""A& 	;	3CXNX%5%56	Z 
8""6;7)Z9PQH11&)D$11&*E	G 	;	3CXN
8  3  4	6r    c                    | j                   }| j                  }|`|j                  j	                  d        ||j
                  j                         d        ||j                  j                         d       | j                  |j                          ||j                  j                  d       |j                  j	                  d        ||j
                  j                         d        ||j                  j                         d       | j                  |j                          ||j                  j                  d       t               |_        y )	NCursor)r   r1  r   rL   Commentr0  r   r   )rO   rh   r   r  ry   fg_onr   bg_onr_   rI  r   rP   r   r   s      r!   test_set_highlight_targetz&HighPageTest.test_set_highlight_target  s    II" 	
x(
177==?45
177==?M*'
1$$a( 	
y)
177==?M*
177==?B'
1$$a(!%r    c                    | j                   }|j                  }|j                  j                          | j	                  |j
                  d       |j                  j                          | j	                  |j
                  d       y )NrL   r   )rh   r   rc  r>   rO   rP   rd  )r/   r@   scss      r!   test_set_color_sample_bindingz*HighPageTest.test_set_color_sample_binding  sZ    II  	Q'	Q'r    c                 p   | j                   }|`|j                  j                  d       |j                  j                  d       |j                          | j                  |j                  j                  |j                  d   d      |j                  j                  dd             t               |_        y )NrF  Tr5  r6  rG  rH  )rh   r   r  ry   rI  rO   r5  r>  r?  r   rJ  r   rQ   s     r!   test_set_color_samplez"HighPageTest.test_set_color_sample  s    II	/	4 	q009<H""++HlC	E "Vr    c                 ,   | j                   }| j                  }|`|j                  j                  }t
        j                  }|j                  j                  d       |j                  j                  d       d}|j                  |       d|j                  _        |j                          ddd}|j                         D ]  \  }}| j                   |d|      |          ||j                  j                  d	       |j                         D ]   \  }}t        j                   d
|d|z   |       " |j                          |j                         D ]  \  }} | |d|      |         ||j                  j                  d       t#               |_        y )NTr   z	IDLE Testr   bluerX  )rH  r6  consolerL   r   zconsole-r   )rO   rh   r   r   rJ  r   GetHighlightr   ry   r   rY  r   rP   r  r}   r   r[  r   )	r/   r   rh   hs_tagghthemenew_consolekeyr   s	            r!   test_paint_theme_samplez$HighPageTest.test_paint_theme_sample  sv   yy#&&//"" 	d#k*'($ 	!%+%-0%++- 	?JCy# 6>	?
4  ''+ &++- 	JJC{E:c>5I	J!%++- 	.JCvi%u-	.
4  ''+"&&r    c                 8   | j                   }| j                  }|j                  j                  d       t	               x}|_        t	               t        _        t	               t        _        d}t        j                  d   j                  |dd       ddit        |<   d}t        j                  d   j                  |dd       dd	it        |<   |j                  j                  d       |j                  j                          |j                  j!                  |       d
|_        |j                  j                           ||j$                  d        |t        |   ddi        |t        j&                  dd      ||g        |t        j                  j$                  d        |t        j                  j$                  d        ||j(                  j$                  d       d|_        |j                  j                           ||j$                  d       | j+                  |t                |t        j&                  dd      |g        ||j                  j                         d        ||j                  j-                         |        |t        j                  j$                  d        |t        j                  j$                  d        ||j(                  j$                  d       |j                  j!                  |       d|_        |j                  j                           ||j$                  d       | j+                  |t                |t        j&                  dd      g         ||j                  j                         d        ||j                  j-                         d        |t        j                  j$                  d        |t        j                  j$                  d        ||j(                  j$                  d       t        `t        `|`y )Nr   z
spam themer   r   r   r   r   zother themer   FrL   r   r   Tr   r   r   r   r   )rO   rh   r2  r   r   askyesnor   rD   r3   r   r   r   r   r   r>   r   ry   r<  rP   r   r   r  r~   )r/   r   r@   yesno
theme_nametheme_name2s         r!   test_delete_customzHighPageTest.test_delete_custom  s,   II	$$^4!V#
+/6()-&!
%//
FGL (&1#%//VWM!)7 3 	
/	  "	*% 	%%'
5<<
8J(F!34
8""6;7*k9RS
6++22A6
6))00!4
1""A& 	%%'
5<<X.
8""6;7+G
1""$b)
1==,
6++22A6
6))00!4
1""A& 	
+&	%%'
5<<X.
8""6;7<
1""$m4
1== 67
6++22A6
6))00!4
1""A&*F,LJr    N)r4   r5   r6   r   rm   rp   rs   r   r   r   r  r
  r  r$  r)  r-  r3  rC  rK  rS  rV  r_  re  rh  rj  rt  rz  r   r    r!   r   r     s       7 7

&'RB*+89-#9J%(%,"*-:^C4!&6@(*(	$)@9r    r   c                       e Zd Z	 ed        Zed        Zd Zd Zd Zd Z	d Z
d Zd	 Zd
 Zd Zd Zd Zd Zd Zd Zy)KeysPageTestc                     t         j                  x}| _        t         j                  j	                  |       t               |_        t               |_        y r$   )r   r[   rh   rY   rZ   r   set_keys_typeload_keys_listrk   s     r!   rm   zKeysPageTest.setUpClass  s8     //)sx4 !V"fr    c                 $    | j                   }|`|`y r$   )rh   r~  r  rk   s     r!   rp   zKeysPageTest.tearDownClass  s    xx 3r    c                    | j                   }t        j                  dd      D ]$  }t        j                  d   j	                  |       & t        j                          d|j                  _        d|j                  _        y )Nr   r   r   )
rh   r   r   r   r   r   r'   r~  rP   r  r   s      r!   rs   zKeysPageTest.setUp  se    II  ..vv> 	=GV$33G<	=!""#r    c                    t        j                          | j                  }| j                  }t	        j
                  d      t        _        |j                          | j                  |j                  j                                 ||j                  j                         d        ||j                  j                         d        ||j                  j                         d        ||j                   j"                  d        ||j$                  j"                  d        ||j$                  j&                  d       t        j(                  ddd	d
       t        j(                  dddd       |j                           ||j                  j                         d        ||j                  j                         d        ||j                   j"                  d        ||j$                  j"                  d        ||j$                  j&                  d       t	        j
                  d      t        _        t	        j
                  d      t        _        t        j(                  dddd       |j                          | j-                  |j                  j                                 ||j                  j                         d        ||j                  j                         d        ||j                   j"                  d        ||j$                  j"                  d        ||j$                  j&                  d       t        `t        `t        j.                          y )NIDLE Classic OSXr   - no custom keys -r   rL   r  r   r   r   r   r   r   r   r   zIDLE Modern Unixr   Keysr   r   r   )r   )r   r&   rh   rO   r   r;   r   CurrentKeysload_key_cfgr_   keyset_sourcer~   r   r   custom_keyset_onr   r~  rP   r  argsr   default_keysr   r   r   s      r!   test_load_key_cfgzKeysPageTest.test_load_key_cfg#  sg   II  $yy6HI	++-.
1>>!34
1== 45
1##%}5
1??!!1%
1""A&
1  "89 	67Hg>67Ix@	
1>>!34
1==(
1??!!1%
1""A&
1  "89  $yyg> $		7I J669c:	,,./
1>>!34
1==(
1??!!1%
1""A&
1  +. ("7r    c                 |   | j                   }| j                  }t               |_        t               |_        |j
                  j                           |t        dddii        ||j                  j                  d        ||j                  j                  d       t        j                          |j                  j                  d       |j                  j                          | j                  t        dddii        ||j                  j                  d        ||j                  j                  d       |`|`y )Nr  r   r   rL   r   r   r   )rO   rh   r   r   r   builtin_keyset_onr>   r   rP   r   r'   r  r   r   s      r!   test_keyset_sourcezKeysPageTest.test_keyset_sourceM  s    II%)V"$(F!	""$
8fy&123
1%%,,a0
1$$++Q/ 	
  0	!!#FY,@#AB
1%%,,a0
1$$++Q/&(Ar    c                    | j                   }| j                  }t        j                  d   j	                  d       g d}|j
                  j                  |d        |t        ddddi        ||j                  d   d        ||j                  j                  d	        ||j                  j                  d
       t        j                          t        j                  dddd       |j
                  j                  |d        |t        dddii        ||j                  d   d        ||j                  j                  d        ||j                  j                  d
       t        j                          |j
                  j                  |d        |t        ddddi        ||j                  d   d        ||j                  j                  d        ||j                  j                  d       y )Nr   r  )IDLE Classic Windowsr  IDLE Modern UNIXr  r  r   r   zNew key set, see HelprL   )r  r   zIDLE Classic Unixr   r   r  r   r   r  )rO   rh   r   r   r   r   r   r   keys_messager  rP   r  r   r'   r   r   s       r!   r   zKeysPageTest.test_builtin_nameb  s   II //7)	 	
i);<
8f'=(:< = 	>
1>>&!#:;
1""A&
1  "89 	6663FG	i);<
8fw(:;<=
1>>&!#:;
1""A&
1  "89 		i);<
8f'9BGHI
1>>&!2&
1""A&
1  "89r    c                    | j                   }|j                  j                  g d       | j                  dt               | j                  |j                  j                  d       t        j                          |j                  j                  g dd       | j                  t        dddii       | j                  |j                  j                  d       y )Nr  r  r   r   r  r   rL   )
rh   r  r   r  r   rO   r  rP   r   r'   rQ   s     r!   r  zKeysPageTest.test_custom_name  s    II 	
R!56*))00!4 		_c2FVSM#:;))00!4r    c                    t        j                  dddd       | j                  }|j                  j	                  d       |j
                  j                  dd       |j
                  j                  dd       |j
                  j                  d	d
       |j
                  j                  d       |j
                  j                  d       |j                  j	                  d       | j                  t        dddii       |j
                  j                  d	       |j
                  j                  d	       |j                  j	                  d       | j                  t        dd
dii       y )Nr   ZzDummyenabler   zmy custom keysr   endcopyrL   zz-in	<Key-F11>ZzDummy_cfgBindings)r   r   rh   r   ry   bindingslistdeleteinsertselection_setselection_anchor
keybindingrO   r[   rE   rQ   s     r!   test_keybindingzKeysPageTest.test_keybinding  s   <HfEII	*+	a'	a(	a(	$$Q'	''*	%*V[,AB	D 	
$$Q'	''*	%/&+1FG	Ir    c                    | j                   }| j                  }|`|j                  j	                  d       |j                           ||j
                  d   t                ||j                  d   t                ||j                  j                         d       |j                  j	                  d       |j                           ||j
                  d   t                ||j                  j                         d        ||j                  d   t                ||j                  j                         d       t               |_        y r/  )rO   rh   r~  r  ry   r   r   r  r   button_delete_custom_keysr   r  r   r   s      r!   test_set_keys_typezKeysPageTest.test_set_keys_type  s    IIO 	
D!	
1==!6*
1<< (+
1&&,,.> 	
E"	
1==!8,
1##%}5
1<< &)
1&&,,.3&r    c                    | j                   }| j                  }t        j                  }t	        d      x}t        _        t	               x}|_        |j                  j                  d       |j                  j                  dd       |j                  j                  dd       |j                  j                  d       |j                  j                  d       |j                  j                  d       |j                  j                  d       d|_        |j                  j#                           ||j                  j%                  d	      d        ||j                  j%                         d       d
|_        d|_        |j                  j#                           ||j&                  d        ||j                  j%                  d	      d       d|_        |j                  j#                           ||j(                  j%                         |j                           ||j                  j%                  d	      d        ||j                  j%                         d
       |j                  j                  d       d|_        d|_        |j                  j#                           ||j&                  d        ||j                  j%                  d	      d        ||j                  j%                         d       |`|t        _        y )NTrM  r   r   r  zcopy - <Control-Shift-Key-C>zKey-ar   r   r  rL   zMy New Key Setzcopy - <Key-F11>Fz<Key-p>zcopy - <Key-p>)rO   rh   r   GetKeysWindowr   get_new_keys_namebutton_new_keysr   r  r  r  r  r  r  ry   r  r<  r>   r~   rP   r   )r/   r   r@   orig_getkeysdialoggkdgnkns         r!   test_get_new_keyszKeysPageTest.test_get_new_keys  sD   II)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                     t         j                  }t        d      x}t         _        | j                  }d|_        | j                  |j                  d      d       |t         _        y )NTrM  zNew Keysr   )r   rO  r   rh   r<  rO   r  rP  s       r!   test_get_new_keys_namez#KeysPageTest.test_get_new_keys_name  sS    '33(,(>>\%II	,,R0*=#3 r    c                    | j                   }t               x}|_        |j                  j	                  d       d|_        |j                  j                          d|_        d|_        | j                  |j
                  t        j                  d          |j                  j                          | j                  |j
                  t        j                  d          |`y )NTr   zmy new key setr   r   )rh   r   r  r  ry   r<  button_save_custom_keysr>   rP   r  r   r   r   )r/   r@   r  s      r!   test_save_as_new_key_setz%KeysPageTest.test_save_as_new_key_set  s    II%)V+q"	D! 	!!((* 'h&6&6v&>?	!!((*dkk8#3#3F#;<r    c                    | j                   }|j                  }|j                  dd       |j                  dd       |j                  dd       |j	                  d       |j                          |j                  d       |j                          |j                  d      \  }}}}||dz  z  }||dz  z  }|j                  ddd       |j                  d	||       |j                  d
||       |j                  d||       | j                  |j                  d      d       | j                  |j                  j                         d       y )Nr   r  r  rL   findr   r  r   r  r   r   r   r   )rh   r  r  r  rI   r   r   rj   r   r   rO   r~   r  r   )r/   r@   r  r   r   r   r   s          r!   test_on_bindingslist_selectz(KeysPageTest.test_on_bindingslist_select  s!   IINN	E	F	F	

1		a	
vvay1b"	R1W	R1W	a1-	qA.	a0	,Q7x&1**002B7r    c                 @   | j                   }| j                  }|j                  j                  d       |j                  j                  d       d}d}| j                  |t        j                         |j                  |        |t        j                  dd      |g        |t        j                  d      t        j                  |              ||j                  j                         |       | j                  |j                  j                                 ||j                  j                  d       t!        j"                  d|dd	       | j                  |t        j                         |j                  |        |t        j                  dd      ||g       | j%                  t        j                  |      t        j                  |             t        j&                  d|dd	        |t        j                  |      t        j                  |             y )
NTr  zmy new custom key setzmy second custom keysetr   r   rL   r  r  )rO   rh   r  ry   r   r  r   r   create_new_key_setr   	GetKeySetr   r~   r   r~  rP   r   r[  r}   r   r\  s        r!   ,test_create_new_key_set_and_save_new_key_setz9KeysPageTest.test_create_new_key_set_and_save_new_key_set  s   II 	
D!	12+	.
 	H$4$45	Y'
8""662YK@
845i(	*
1==	*,,./
1??!!1% 	69fkBX%5%56	Z(
8""662Y
4KLH..y9$..z:	< 	69fkB
8i((*<*<Z*HIr    c                     | j                   }| j                  }t               x}t        _        |`|j                  }|j                  dd       |j                  dd       |j                  dd       ddgdgd	gd
|_	        t        j                  dddd       d}|j                  d        ||j                  dd      |        ||j                  d      d        ||j                         d       |j                  d       |j                  d       |j                  d        ||j                  dd      |        ||j                  d      d        ||j                         d       |j                  d       |j                  d       |j                  d        ||j                  dd      |        ||j                  d      d        ||j                         d       t               |_        t        `y )Nr   r  z<<find>>rL   z<<help>>z<Control-Key-c>z<Control-Key-C>z<Control-Key-space>r  )z<<copy>>z<<force-open-completions>>z<<spam>>r   zmy keysr   z<Shift-Key-a>)z&copy - <Control-Key-c> <Control-Key-C>,force-open-completions - <Control-Key-space>spam - <Shift-Key-a>r   r   r   r  )rL   r   r  )r   )rO   rh   r   r   r  r  r  r  r  r<  r   r[  r~   curselectionr  r  )r/   r   r@   gksr  r   s         r!   test_load_keys_listz KeysPageTest.test_load_keys_list:  s   II#'6)h NN	E	J	J#46G"H5J4K#.-1
 	69foF,
 	
#
155E?H%
155?B
1>>R  	
	1	#
155E?H%
155?JK
1>>U# 	
	1	#
155E?H%
155?23
1>>U#6r    c                 8   | j                   }| j                  }|j                  j                  d       t	               x}|_        t	               t        _        t	               t        _        d}t        j                  d   j                  |dd       ddit        |<   d}t        j                  d   j                  |dd       dd	it        |<   |j                  j                  d       |j                  j                          |j                  j!                  |       d
|_        |j                  j                           ||j$                  d        |t        |   ddi        |t        j&                  dd      ||g        |t        j                  j$                  d        |t        j                  j$                  d        ||j(                  j$                  d       d|_        |j                  j                           ||j$                  d       | j+                  |t                |t        j&                  dd      |g        ||j                  j                         d        ||j                  j-                         |        |t        j                  j$                  d        |t        j                  j$                  d        ||j(                  j$                  d       |j                  j!                  |       d|_        |j                  j                           ||j$                  d       | j+                  |t                |t        j&                  dd      g         ||j                  j                         d        ||j                  j-                         d        |t        j                  j$                  d        |t        j                  j$                  d        ||j(                  j$                  d       t        `t        `|`y )Nr   zspam key setr   r   r   r   r   zother key setr   FrL   r   r   Tr   r   r   r   r  )rO   rh   r  r   r   rv  r   rD   r3   r   r   r   r[   r  r>   r   ry   r<  rP   r   r~  r  r~   )r/   r   r@   rw  keyset_namekeyset_name2s         r!   test_delete_custom_keysz$KeysPageTest.test_delete_custom_keyse  s&   II	##)).9!V#
+/6()-&$ **;H!)6 2& **<I"*G!4 	
  0	!!#	+& 	##**,
5<<
8K 8V"45
8""662[,4OP
6++22A6
6))00!4
1??!!1% 	##**,
5<<h/
8""662\NC
1##%r*
1==-
6++22A6
6))00!4
1??!!1% 	
,'	##**,
5<<h/
8""662B7
1##%}5
1== 45
6++22A6
6))00!4
1??!!1%*F,LJr    N)r4   r5   r6   r   rm   rp   rs   r  r  r   r  r  r  r  r  r  r  r  r  r  r   r    r!   r|  r|    s|     % % 4 4$(TB*:@5I*!*.8`4 $8*J>)V9r    r|  c                   T    e Zd Z	 ed        Zd Zd Zd Zd Zd Z	d Z
d Zd	 Zd
 Zy)WinPageTestc                     t         j                  x}| _        t         j                  j	                  |       |j                          y r$   )r   winpagerh   rY   rZ   rj   rk   s     r!   rm   zWinPageTest.setUpClass  s-     ..(sx4 r    c                 ,    t        j                          y r$   rr   r.   s    r!   rs   zWinPageTest.setUp  rt   r    c                    | j                   }| j                  }|j                  j                  d       |j                  j                  d       |j
                  j                  d       |j                           ||j                  j                         d        ||j                  j                         d        ||j
                  j                         d       y )NrL   r   80r   )rO   rh   startup_editry   	win_width
win_heightload_windows_cfgr~   r   s      r!   test_load_windows_cfgz!WinPageTest.test_load_windows_cfg  s    II	1			
1>>#
1;;??d#
1<<t$r    c                    | j                   }|j                  j                          | j                  t        dddii       t        j                          |j                  j                          | j                  t        dddii       y )NGeneralzeditor-on-startuprw   r   )rh   startup_editor_onr>   rO   r   r   r'   startup_shell_onrQ   s     r!   test_startupzWinPageTest.test_startup  sv    II	""$#&93%?@	B	!!##&93%?@	Br    c                    | j                   }|j                  j                  dd       |j                  j                  dd       | j	                  t
        dddii       t        j                          |j                  j                  dd       |j                  j                  dd       | j	                  t
        dddii       y )Nr   r  11r   heightwidth)	rh   win_height_intr  r  rO   r   r   r'   win_width_intrQ   s     r!   test_editor_sizezWinPageTest.test_editor_size  s    II	5)	4(NXt4D#EF	q%(	q$'NWdO#DEr    c                     | j                   }|j                  j                  d       | j                  |j                  j                         d       | j                  t        dddii       y )N   6Indentz
num-spaces)rh   indent_chooserry   rO   indent_spacesr~   r   rQ   s     r!   test_indent_spaceszWinPageTest.test_indent_spaces  sV    II	Q,,.4H|S.A#BCr    c                     | j                   j                  j                          | j                  t        dddii       y )Nr   zcursor-blinkr   )rh   cursor_blink_boolr>   rO   r   r.   s    r!   test_cursor_blinkzWinPageTest.test_cursor_blink  s2    		##**,N^W4M#NOr    c                     | j                   j                  j                  dd       | j                   j                  j                  dd       | j	                  t
        dddii       y )Nr   r  r  AutoComplete	popupwait)rh   auto_wait_intr  r  rO   rE   r.   s    r!   test_autocomplete_waitz"WinPageTest.test_autocomplete_wait  sP    		&&q%0		&&q$/>K3F"GHr    c                    | j                   }| j                  }|j                  d   j                  d        |t        dddii       t        j                          |j                  j                  dd       |j                  j                  dd        |t        dddii       t        j                          |j                  j                           |t        dd	d
ii       y )Nmenur   
ParenMatchr5  openerr  r  zflash-delaybellr   )rh   rO   paren_style_typer>   rE   r   r'   paren_flash_timer  r  bell_onr   s      r!   test_parenmatchzWinPageTest.test_parenmatch  s    II	6"))!,
7\GX#678	!!!U+	!!!T*
7\M4#89:			
7\FG#456r    c                     | j                   j                  j                  dd       | j                   j                  j                  dd       | j	                  t
        dddii       y )Nr   r  r  FormatParagraphz	max-width)rh   format_width_intr  r  rO   rE   r.   s    r!   test_paragraphzWinPageTest.test_paragraph  sQ    		""))!U3		""))!T2#4{D6I"JKr    N)r4   r5   r6   r   rm   rs   r  r  r  r  r  r  r  r  r   r    r!   r  r    sN    
  

%BFDPI
7Lr    r  c                   6    e Zd Z	 ed        Zd Zd Zd Zd Zy)ShedPageTestc                     t         j                  x}| _        t         j                  j	                  |       |j                          y r$   )r   shedpagerh   rY   rZ   rj   rk   s     r!   rm   zShedPageTest.setUpClass  s-     //)sx4 r    c                 ,    t        j                          y r$   rr   r.   s    r!   rs   zShedPageTest.setUp  rt   r    c                     | j                   }| j                  }|j                  j                  d       |j	                           ||j                  j                         d       y )NrL   r   )rO   rh   autosavery   load_shelled_cfgr~   r   s      r!   test_load_shelled_cfgz"ShedPageTest.test_load_shelled_cfg  sG    II	

q	
1::>>Qr    c                     | j                   }|j                  j                          | j                  t        dddii       |j
                  j                          | j                  t        dddii       y )Nr  r  rw   r   )rh   save_auto_onr>   rO   r   save_ask_onrQ   s     r!   test_autosavezShedPageTest.test_autosave	  s_    II	I
C/@#AB	I
C/@#ABr    c                     | j                   j                  j                  dd       | j                   j                  j                  dd       | j	                  t
        dddii       y )Nr   r  rw   CodeContextmaxlines)rh   context_intr  r  rO   rE   r.   s    r!   test_contextzShedPageTest.test_context  sP    		$$Q.		$$Q,=:s2C"DEr    N)	r4   r5   r6   r   rm   rs   r  r  r
  r   r    r!   r  r    s1    
  
 CFr    r  c                       e Zd Z	 ed        Zy)ExtPageTestc                 b    t         j                  }t         j                  j                  |       y r$   )r   rE   rY   rZ   rk   s     r!   rm   zExtPageTest.setUpClass  s    ~~4 r    N)r4   r5   r6   r   rm   r   r    r!   r  r    s    9! !r    r  c                   ^    e Zd Z	 ed        Zed        Zd Zd Zd Zd Z	d Z
d Zd	 Zd
 Zy)HelpSourceTestc                     t         j                  }t         j                  j                  |       |j                  x}| _        t               x|_        |_        t               x|_	        |_
        |j                          y r$   )r   rE   rY   rZ   
frame_helpframer   ry   set_add_delete_stateupcupdate_help_changesrj   )rl   rh   r  s      r!   rm   zHelpSourceTest.setUpClass!  sX    ~~4  OO+	157	E.046	E-r    c                     | j                   }|`|`|`|`|j
                  j                  dd       |j                  j                          y )Nr   r  )	r  ry   r  r  r  helplistr  user_helplistr'   )rl   r  s     r!   rp   zHelpSourceTest.tearDownClass*  sE    		Iu1Iu0a'!!#r    c                 ,    t        j                          y r$   rr   r.   s    r!   rs   zHelpSourceTest.setUp2  rt   r    c                 <   | j                   }| j                  }|j                  j                  dd       ddg|_        t        j                  dddd       |j                           ||j                  j                  dd      d	        ||j                  d
g       y )Nr  badworser   	HelpFilesrw   z	name;filer   )r   )r   filerw   )	rO   r  r  r  r  r   r   load_helplistr~   r/   r   frs      r!   test_load_helplistz!HelpSourceTest.test_load_helplist5  s    ZZ
5%(!7+6;[A

2;;??1e$i0
2345r    c                 *   | j                   }|j                  |_        |j                  |_        |j
                  }d}|j                  |d       |j                  |       |j                          |j                  |       |j                          |j                  |      \  }}}}||dz  z  }||dz  z  }dx|j                  _        |j                  _        |j                  ddd       |j                  d||       |j                  d||       |j                  d	||       | j                  |j                  d
      d       | j!                  |j                  j                         | j#                  |j                  j                         y )Nr  sourcer   r   r  r   r  r   r   r   )r  r  ry   r  r  r  r  rI   r   r   rj   r   rP   r   rO   r~   r_   r   )r/   r!  r  dexr   r   r   r   s           r!   test_source_selectedz#HelpSourceTest.test_source_selected?  sO   ZZ(('';;X&#S}}S)1b"	R1W	R1W())	Q!4
a15Q7 3qA>h/:&'r    c                    | j                   }| j                  }|`|j                  }|j                  }|j	                  dd        |         ||j
                  j                         d        ||j                  j                         d       |j                  dd        |         ||j
                  j                         d        ||j                  j                         d       |j                  d        |         ||j
                  j                         d        ||j                  j                         d       t               |_        y )Nr   r  r   r$  r   )rO   r  r  r  r  button_helplist_editr   button_helplist_remover  r  r   )r/   r   r!  sadhs        r!   test_set_add_delete_statez(HelpSourceTest.test_set_add_delete_stateW  s   ZZ#%%KK	E
2""((*M:
2$$**,m<	H
2""((*M:
2$$**,m<	
2""((*B/
2$$**,b1"&&r    c                    | j                   }t        j                  }t        d      x}t        _        | j                  }|j
                  j                  dd       |j                  j                          dx|j                  _
        |j                  _
        d|_        |j                          | j                  t        |j
                  j!                  dd            |j                  cxk(  xr g k(  nc        | j#                  |j                  j                         d|_        |j                          d|_        |j                           ||j
                  j!                  dd      d        ||j                  ddg        ||j                  j                  d	       | j#                  |j                  j                         |t        _        y )
NTrM  r   r  r   name1file1r   file2)r/  r   r   )rO   r   
HelpSourcer   r  r  r  r  r'   ry   rP   r  r<  helplist_item_addr_   listr~   r   r/   r   orig_helpsourcer  r!  s        r!   test_helplist_item_addz%HelpSourceTest.test_helplist_item_addo  sY    &11'+'==\$ZZ
1e$
 ())	
R[[__Q67((/,./ 	0'&	
&	

2;;??1e$&89
202DEF
266==!'"1r    c                 `   | j                   }t        j                  }t        d      x}t        _        | j                  }|j
                  j                  dd       |j
                  j                  dd       |j
                  j                  d       |j
                  j                  d       |j                  j                          |j                  j                  d       dx|j                  _        |j                  _        d|_        |j#                          d|_        |j#                           ||j
                  j%                  dd      d        ||j                  dg       | j'                  |j                  j                         d	|_        |j#                           ||j
                  j%                  dd      d
        ||j                  d	g       | j)                  |j                  j                  |j                  j                  cxk(  xr dk(  nc        |t        _        y )NTrM  r   r  r/  r.  r   )r/  r1  )r   rL   )rO   r   r3  r   r  r  r  r  r  r  r  r'   appendry   rP   r  r<  helplist_item_editr~   r   r_   r6  s        r!   test_helplist_item_editz&HelpSourceTest.test_helplist_item_edit  s   &11'+'==\$ZZ
1e$
1g&
!!!$
$$Q'
 
 23())	
&	

2;;??1e$j1
2012'&	

2;;??1e$j1
2012;!;<"1r    c                    | j                   }| j                  }|j                  j                  dd       |j                  j	                  dd       |j                  j                  d       |j                  j                  d       |j                  j                          |j                  j                  d       dx|j                  _        |j                  _        |j                           ||j                  j                  dd      d        ||j                  g        | j                  |j                  j                  |j                  j                  cxk(  xr
 dk(         y c        y )Nr   r  r/  r.  r   rL   )rO   r  r  r  r  r  r  r  r'   r:  ry   rP   r  helplist_item_remover~   r_   r   s      r!   test_helplist_item_removez(HelpSourceTest.test_helplist_item_remove  s    ZZ
1e$
1g&
!!!$
$$Q'
 
 23())
!
2;;??1e$b)
2R ;!;<;<r    c                 6   | j                   }|`|j                  j                          |j                  j	                  d       |j                  j	                  d       |j                          | j                  t        d   ddd       t               |_        y )Nr.  r1  r  zname1;file1zname2;file2)rw   2)r  r  r  r'   r:  rO   r   r   )r/   r!  s     r!   test_update_help_changesz'HelpSourceTest.test_update_help_changes  s    ZZ"
 
 23
 23
 +.,=A	C!%r    N)r4   r5   r6   r   rm   rp   rs   r"  r&  r,  r8  r<  r?  rB  r   r    r!   r  r    sS    9  $ $6(0)0282<= 
(r    r  c                   \    e Zd Zed        Zed        Zd Zd Zd Zd Z	d Z
d Zd	 Zd
 Zy)VarTraceTestc                     t        j                         | _        t        t              | _        t        t              | _        y r$   )r   VarTracer   r
   r   ivr   bvro   s    r!   rm   zVarTraceTest.setUpClass  s)    "++-D!r    c                     | ` | `| `y r$   )r   rG  rH  ro   s    r!   rp   zVarTraceTest.tearDownClass  s    Kr    c                 F    | j                   j                          d| _        y r  )r   r'   rP   r.   s    r!   rs   zVarTraceTest.setUp  s    r    c                 .    | xj                   dz  c_         y )N   )rP   r/   paramss     r!   var_changed_incrementz"VarTraceTest.var_changed_increment  s    rr    c                      y r$   r   rM  s     r!   var_changed_booleanz VarTraceTest.var_changed_boolean  r1   r    c                     | j                   }|j                          | j                  |j                  g        | j                  |j                  g        y r$   )r   __init__rO   untracedtracedr/   trs     r!   	test_initzVarTraceTest.test_init  s<    \\
b)B'r    c                    | j                   }|j                  j                  d       |j                  j                  d       |j	                          | j                  |j                  g        | j                  |j                  g        y )Nr   rL   )r   rT  r:  rU  r'   rO   rV  s     r!   
test_clearzVarTraceTest.test_clear  s`    \\
1
		

b)B'r    c                    | j                   }t               }t        j                  |      x}|_        |j                  | j                  | j                        }| j                  || j                         |j                  | j                  | j                        }| j                  || j                         t        t              }|j                  |d      }| j                  ||       |j                          |j                  |d       || j                  f|| j                  f||fg}| j                  |j                   g        | j                  |j"                  |       |`y )Nr   r   r   r   )r   r   r   r;   make_callbackaddrG  rO  assertIsrH  rQ  r	   r   r?   assert_called_withrO   rU  rT  )	r/   rW  funccbrG  rH  svsv2r   s	            r!   test_addzVarTraceTest.test_add  s   \\v $		t <<RVVDGGT778b$''"VVDGGT556b$''"t_ffR67c2

b"?@334112J  	B'h/r    c                    | j                   j                  | j                  d      }| j                  t	        |             | j                  j                  d       | j                  dt        d           |        | j                  dt        d          | j                  t        d   d   d   d       t        j                          y )Nr\  *   r   r   r   42)r   r]  rG  r_   callablery   r  r   r   rO   r'   )r/   rb  s     r!   test_make_callbackzVarTraceTest.test_make_callback  s    \\''1NO%BGFO4
i13H=tDr    c                    | j                   }|j                  | j                  | j                        }|j                  | j                  | j
                        }|| j                  f|| j
                  fg}|j                          | j                  |j                  g        | j                  |j                  |       |j                  d       | j                  |j                         d       | j                  | j                  d       d| _        |j                          |j                  d       | j                  | j                  d       d| _        |j                          | j                  |j                  g        | j                  |j                  |       |j                  d       | j                  | j                  d       y )NrL   rL  r   )r   r^  rG  rO  rH  rQ  r   rO   rT  assertCountEqualrU  ry   r~   rP   r&   )r/   rW  rG  rH  r   s        r!   test_attach_detachzVarTraceTest.test_attach_detach  sT   \\VVDGGT778VVDGGT5563341124 			b)bii2
q	1%b)
 
		
q	b) 
		B'bkk84
q	a(r    N)r4   r5   r6   r   rm   rp   rs   rO  rQ  rX  rZ  re  rj  rm  r   r    r!   rD  rD    sP    " "
 ( (((0
)r    rD  __main__r   )	verbosity)-idlelibr   test.supportr   unittestr   idlelib.idle_test.mock_idler   tkinterr   r	   r
   r   r   r   r   idlelib.configdialogr   r   r   r   r%   IdleUserConfParserr   r   r   r   r   r[   rE   r"   r*   TestCaser,   r8   re   r   r|  r  r  r  r  rD  r4   r   r   r    r!   <module>rx     s   ! !    , I I  ; ;
 

%F%%b)***2.%F%%b)+&++B/	 	6?;6?
,
Bx(( (B"" (BV[8$$ [||8$$ |~X8$$ XvNL(## NLb!F8$$ !FJ!(## !d(X&& d(Ne)8$$ e)P zHMMA r    