
    daf_                        d dl Z d dlZd dlmZ d dlZd dlmZ d dlmZmZm	Z	m
Z
 d dlmZmZmZmZmZ  ed       d Z G d d	ee      Z ee       G d
 dee j&                               Z ee       G d dee j&                               Z ee       G d dee j&                               Z G d dee      Z ee       G d dee j&                               Z ee       G d dee j&                               Z ee       G d dee j&                               Z ee       G d dee j&                               Z ee       G d dee j&                               Z G d dee j&                        Z eee       G d dee j&                               Z ee       G d  d!ee j&                               Z ee       G d" d#ee j&                               Z  eee       G d$ d%ee j&                               Z! eee       G d& d'ee j&                               Z" eee       G d( d)ee j&                               Z# eee       G d* d+ee j&                               Z$ ee       G d, d-ee j&                               Z% ee       G d. d/ee j&                               Z& eee       G d0 d1ee j&                               Z' G d2 d3e
e j&                        Z(ee!eeeeee"ee&e'ee%ee#e$ee ee(fZ)e*d4k(  r e jV                          yy)5    N)TclError)requires)requires_tkget_tk_patchlevel	widget_eqAbstractDefaultRootTest)add_standard_optionsAbstractWidgetTestStandardOptionsTestsIntegerSizeTestsPixelSizeTestsguic                 *    t        t        |             S N)floatround)xs    9/root/Python-3.12.4/Lib/test/test_tkinter/test_widgets.pyfloat_roundr      s    q?    c                   (    e Zd ZdZd Zd Zd Zd Zy)AbstractToplevelTestFc                 
   | j                         }| j                  |d   |j                  j                  j	                                | j                  |ddd       | j                  d      }| j                  |d   d       y )NclassFooz2can't modify -class option after widget is createderrmsg)class_)createassertEqual	__class____name__titlecheckInvalidParamselfwidgetwidget2s      r   test_configure_classz)AbstractToplevelTest.test_configure_class   s{    ))2288:	<vwK 	 	M++U++)51r   c                     | j                         }| j                  |d   d       | j                  |ddd       | j                  d      }| j                  |d   d       y )Ncolormap newz5can't modify -colormap option after widget is createdr   )r+   r   r    r$   r%   s      r   test_configure_colormapz,AbstractToplevelTest.test_configure_colormap!   sd    
+R0vz5N 	 	P++u+-,e4r   c                    | j                         }| j                  |d   | j                  rdnd       | j                  |ddd       | j                  d      }| j                  |d   | j                  rd       y d	       y )
N	containerr   0   z6can't modify -container option after widget is createdr   Tr1   1)r   r    wantobjectsr$   r%   s      r   test_configure_containerz-AbstractToplevelTest.test_configure_container)   s{    ,43C3CaMv{AO 	 	Q+++--D4D4DqN#Nr   c                     | j                         }| j                  |d   d       | j                  |ddd       | j                  d      }| j                  |d   d       y )Nvisualr,   defaultz3can't modify -visual option after widget is createdr   )r9   r.   r%   s      r   test_configure_visualz*AbstractToplevelTest.test_configure_visual1   sd    )2.vxL 	 	N++Y+/*I6r   N)r"   
__module____qualname___conv_pad_pixelsr)   r/   r7   r;    r   r   r   r      s    25O7r   r   c                   (    e Zd ZdZd Zd Zd Zd Zy)ToplevelTest)
backgroundborderwidthr   r+   r1   cursorheighthighlightbackgroundhighlightcolorhighlightthicknessmenupadxpadyreliefscreen	takefocususer9   widthc                 B    t        j                  | j                  fi |S r   )tkinterToplevelrootr&   kwargss     r   r   zToplevelTest.createD   s    		4V44r   c                     | j                         }t        j                  | j                        }| j	                  |d|t
               | j	                  |dd       y )NrI   eqr,   )r   rR   MenurT   
checkParamr   r&   r'   rI   s      r   test_configure_menuz ToplevelTest.test_configure_menuG   sC    ||DII&;+r   c                 n   | j                         }|j                  dk7  r| j                  d       | j                  |d   d       	 t        j
                  d   }| j                  |dd       | j                  |	      }| j                  |d   |       y # t        $ r | j                  d       Y Yw xY w)
Nx11zNot using Tk for X11rM   r,   DISPLAYzNo $DISPLAY set.z3can't modify -screen option after widget is createdr   )rM   )r   _windowingsystemskipTestr    osenvironKeyErrorr$   )r&   r'   displayr(   s       r   test_configure_screenz"ToplevelTest.test_configure_screenM   s    ""e+MM01)2.	.jj+G 	vxL 	 	N++W+-*G4  	.MM,-	.s   B B43B4c                 @   | j                         }| j                  |d   d       | j                  d      }t        |j                               }| j	                  |      5  | j                  |      }| j                  |d   |       d d d        y # 1 sw Y   y xY w)NrO   r,   Tr4   )wid)rO   )r   r    hexwinfo_idsubTest)r&   r'   parentri   r(   s        r   test_configure_usezToplevelTest.test_configure_use[   s    +t,&//#$\\c\" 	2kkck*GWU^S1	2 	2 	2s   #(BBN)r"   r<   r=   OPTIONSr   r]   rg   rn   r?   r   r   rA   rA   :   s    G5,52r   rA   c                       e Zd ZdZd Zy)	FrameTest)rB   rC   r   r+   r1   rD   rE   rF   rG   rH   rJ   rK   rL   rN   r9   rP   c                 B    t        j                  | j                  fi |S r   )rR   FramerT   rU   s     r   r   zFrameTest.createn       }}TYY1&11r   Nr"   r<   r=   ro   r   r?   r   r   rq   rq   e   s    G2r   rq   c                   "    e Zd ZdZd Zd Zd Zy)LabelFrameTest)rB   rC   r   r+   r1   rD   font
foregroundrE   rF   rG   rH   labelanchorlabelwidgetrJ   rK   rL   rN   textr9   rP   c                 B    t        j                  | j                  fi |S r   )rR   
LabelFramerT   rU   s     r   r   zLabelFrameTest.create}       !!$))6v66r   c                     | j                         }| j                  |ddddddddd	d
ddd       | j                  |dd       y )Nrz   eenesnnenwsseswwwnwscenter)r   checkEnumParamr$   r&   r'   s     r   test_configure_labelanchorz)LabelFrameTest.test_configure_labelanchor   sM    FMtS$tS$	> 	v}h?r   c                     | j                         }t        j                  | j                  dd      }| j	                  |d|d       |j                          y )NMuppfoo)r|   namer{   z.fooexpected)r   rR   LabelrT   r[   destroy)r&   r'   labels      r   test_configure_labelwidgetz)LabelFrameTest.test_configure_labelwidget   s@    diif5AuvFr   N)r"   r<   r=   ro   r   r   r   r?   r   r   rw   rw   r   s    G7@r   rw   c                       e Zd ZdZd Zy)AbstractLabelTestFc           
      T    | j                         }| j                  |ddddddd       y )NrH   r   ?@   10pr   checkPixelsParamr   s     r   !test_configure_highlightthicknessz3AbstractLabelTest.test_configure_highlightthickness   s-    f&:c1b%	9r   N)r"   r<   r=   _conv_pixelsr   r?   r   r   r   r      s    L9r   r   c                       e Zd ZdZd Zy)	LabelTest)activebackgroundactiveforegroundanchorrB   bitmaprC   compoundrD   disabledforegroundrx   ry   rE   rF   rG   rH   imagejustifyrJ   rK   rL   staterN   r|   textvariable	underlinerP   
wraplengthc                 B    t        j                  | j                  fi |S r   )rR   r   rT   rU   s     r   r   zLabelTest.create   rt   r   Nru   r?   r   r   r   r      s    G2r   r   c                       e Zd ZdZd Zd Zy)
ButtonTest) r   r   r   rB   r   rC   commandr   rD   r:   r   rx   ry   rE   rF   rG   rH   r   r   
overreliefrJ   rK   rL   repeatdelayrepeatintervalr   rN   r|   r   r   rP   r   c                 B    t        j                  | j                  fi |S r   )rR   ButtonrT   rU   s     r   r   zButtonTest.create       ~~dii2622r   c                 N    | j                         }| j                  |dddd       y )Nr:   activedisablednormalr   r   r   s     r   test_configure_defaultz!ButtonTest.test_configure_default   s#    FIxXNr   N)r"   r<   r=   ro   r   r   r?   r   r   r   r      s    	,G3Or   r   c                   .    e Zd ZdZd Zd Zd Zd Zd Zy)CheckbuttonTest)&r   r   r   rB   r   rC   r   r   rD   r   rx   ry   rE   rF   rG   rH   r   indicatoronr   	offreliefoffvalueonvaluer   rJ   rK   rL   selectcolorselectimager   rN   r|   r   tristateimagetristatevaluer   variablerP   r   c                 B    t        j                  | j                  fi |S r   )rR   CheckbuttonrT   rU   s     r   r   zCheckbuttonTest.create       ""499777r   c                 P    | j                         }| j                  |ddddd       y )Nr   r3   ffffff@r,   
any stringr   checkParamsr   s     r   test_configure_offvaluez'CheckbuttonTest.test_configure_offvalue   s%    QRFr   c                 P    | j                         }| j                  |ddddd       y )Nr   r3   r   r,   r   r   r   s     r   test_configure_onvaluez&CheckbuttonTest.test_configure_onvalue   s%    AsBEr   c                    g }g }t        d      D ]  }t        j                  | j                        }|j	                          |j                  |       dD ]:  }t        j                  ||      }|j	                          |j                  |       <  |D cg c]  }t        |d          }}| j                  t        t        |            d|       y c c}w )N   AB)r|   r      )rangerR   rs   rT   packappendr   strr    lenset)r&   framesbuttonsifjb	variabless           r   test_unique_variablesz%CheckbuttonTest.test_unique_variables   s    q 	"Adii(AFFHMM! "''2q!"		" 299AS:'9	9S^,a; :s   Cc                    t        j                  | j                        }t        j                  | j                        }t        j                  |dd      }t        j                  |dd      }t        j                  | j                  d      }|j                          | j                  |j                         d       |j                          | j                  |j                         d       y )NtestTest1)r   r|   Test2r   r3   r   )	rR   rs   rT   r   IntVarselectr    getdeselect)r&   f1f2b1b2vs         r   test_same_namezCheckbuttonTest.test_same_name   s    ]]499%]]499%  &w?  &w?NN49962
		!$
!$r   N)	r"   r<   r=   ro   r   r   r   r   r   r?   r   r   r   r      s$    G8GF<
%r   r   c                       e Zd ZdZd Zd Zy)RadiobuttonTest)%r   r   r   rB   r   rC   r   r   rD   r   rx   ry   rE   rF   rG   rH   r   r   r   r   r   rJ   rK   rL   r   r   r   rN   r|   r   r   r   r   valuer   rP   r   c                 B    t        j                  | j                  fi |S r   )rR   RadiobuttonrT   rU   s     r   r   zRadiobuttonTest.create  r   r   c                 P    | j                         }| j                  |ddddd       y )Nr   r3   r   r,   r   r   r   s     r   test_configure_valuez$RadiobuttonTest.test_configure_value  s%    !S"lCr   N)r"   r<   r=   ro   r   r  r?   r   r   r   r      s    G8Dr   r   c                   \    e Zd ZdZeZd Zd Zd Ze	j                  Z
d Zd Zd Zd Zd	 Zy
)MenubuttonTest)r   r   r   rB   r   rC   r   rD   	directionr   rx   ry   rE   rF   rG   rH   r   r   r   rI   rJ   rK   rL   r   rN   r|   r   r   rP   r   c                 B    t        j                  | j                  fi |S r   )rR   
MenubuttonrT   rU   s     r   r   zMenubuttonTest.create  r   r   c           	      R    | j                         }| j                  |dddddd       y )Nr  abovebelowflushleftrightr   r   s     r   test_configure_directionz'MenubuttonTest.test_configure_direction  s*    FK'67	<r   c                 Z    | j                         }| j                  |ddddt               y )NrE   d   r   convr   checkIntegerParamr   r   s     r   test_configure_heightz$MenubuttonTest.test_configure_height!  s(    vxdACHr   c                 :   | j                         }t        j                  | j                  d      }| j	                  |d|t
               d}| j                  t        j                        5 }d|d<   d d d        |%| j                  t        j                        |       | j                  t        j                        5 }|j                  ddi       d d d        |&| j                  t        j                        |       y y # 1 sw Y   xY w# 1 sw Y   >xY w)Nimage1)masterr   r   r  zimage "spam" doesn't existspam)r   rR   
PhotoImagerT   r[   r   assertRaisesr   r    	exception	configure)r&   r'   r   r   cms        r   test_configure_imagez#MenubuttonTest.test_configure_image(  s    ""$))(CS9.w//0 	%B$F7O	%S.7w//0 	0Bgv./	0S.7 	% 	%	0 	0s   ,D DDDc                     | j                         }t        j                  |d      }| j                  |d|t               |j                          y )NrI   r   rX   )r   rR   rZ   r[   r   r   r\   s      r   r]   z"MenubuttonTest.test_configure_menu6  s:    ||F0;r   c                 z    | j                         }| j                  |ddddd       | j                  |ddd       y )	NrJ      皙@ffffff@12mr   r   r   r   r   r[   r   s     r   test_configure_padxz"MenubuttonTest.test_configure_padx<  9    ffac5AQ7r   c                 z    | j                         }| j                  |ddddd       | j                  |ddd       y )	NrK   r#  r$  r%  r&  r   r   r   r'  r   s     r   test_configure_padyz"MenubuttonTest.test_configure_padyA  r)  r   c                 Z    | j                         }| j                  |ddddt               y )NrP     nr   r  r  r   s     r   test_configure_widthz#MenubuttonTest.test_configure_widthF  s(    vwT13Gr   N)r"   r<   r=   ro   r   r   r   r  r  r   r   r   r]   r(  r+  r/  r?   r   r   r  r  
  sJ    
G L7<
I
 	>> &88
8
Hr   r  c                       e Zd ZddZd Zy)OptionMenuTestc                 L    t        j                  | j                  d |g|i |S r   )rR   
OptionMenurT   )r&   r:   valuesrV   s       r   r   zOptionMenuTest.createM  s%    !!$))T7NVNvNNr   c                     | j                  t        d      5  t        j                  | j                  d dd       d d d        y # 1 sw Y   y xY w)Nz^unknown option -image$r   r,   )r   )assertRaisesRegexr   rR   r3  rT   r&   s    r   test_bad_kwargzOptionMenuTest.test_bad_kwargP  s@    ##H.HI 	?tyy$2>	? 	? 	?s   $AAN)r   )ar   c)r"   r<   r=   r   r8  r?   r   r   r1  r1  K  s    O?r   r1  c                   R    e 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)	EntryTest)rB   rC   rD   disabledbackgroundr   exportselectionrx   ry   rF   rG   rH   insertbackgroundinsertborderwidthinsertofftimeinsertontimeinsertwidthinvalidcommandr   readonlybackgroundrL   selectbackgroundselectborderwidthselectforegroundshowr   rN   r   validatevalidatecommandrP   xscrollcommandc                 B    t        j                  | j                  fi |S r   )rR   EntryrT   rU   s     r   r   zEntryTest.created  rt   r   c                 H    | j                         }| j                  |d       y )Nr=  r   checkColorParamr   s     r   !test_configure_disabledbackgroundz+EntryTest.test_configure_disabledbackgroundg      V%9:r   c           
          | j                  d      }| j                  |ddddddd	       | j                  |dd
d       y )Nr  )rC  r@  r   r   r   r   r   r   <   2   r   r'  r   s     r    test_configure_insertborderwidthz*EntryTest.test_configure_insertborderwidthk  sI    -f&9c1b%	9 	 3R&Ir   c                     | j                         }| j                  |dddd       | j                  |ddd       | j                  |ddd       | j                  |dd	d
       y )NrC  r   @r   g?r   r   r   g?r3   r'  r   s     r   test_configure_insertwidthz$EntryTest.test_configure_insertwidthr  s_    fmS#uEsQ?rA>sQ?r   c                 l    | j                         }| j                  |d       | j                  |d       y )NrD  invcmdr   checkCommandParamr   s     r   test_configure_invalidcommandz'EntryTest.test_configure_invalidcommandy  s.    v'78vx0r   c                 H    | j                         }| j                  |d       y )NrE  rP  r   s     r   !test_configure_readonlybackgroundz+EntryTest.test_configure_readonlybackground~  rS  r   c                     | j                         }| j                  |dd       | j                  |dd       | j                  |dd       y )NrI  *r,    r   r[   r   s     r   test_configure_showzEntryTest.test_configure_show  s=    ,+,r   c                 N    | j                         }| j                  |dddd       y )Nr   r   r   readonlyr   r   s     r   test_configure_statezEntryTest.test_configure_state  s&    FG&*	>r   c           
      T    | j                         }| j                  |ddddddd       y )NrJ  allkeyfocusfocusinfocusoutnoner   r   s     r   test_configure_validatez!EntryTest.test_configure_validate  s-    FJugy*f	Fr   c                 l    | j                         }| j                  |d       | j                  |d       y )NrK  vcmdr]  r   s     r   test_configure_validatecommandz(EntryTest.test_configure_validatecommand  s.    v'89vv.r   c                 <   | j                         }|j                  dd       | j                  |j                                |j	                  dd       | j                  |j                         d       | j                  |j                                |j                  d       |j                  d       | j                  |j                         d       |j	                  dd       | j                  |j                         d	       |j                          | j                  |j                                |j	                  dd       |j                  d       | j                  |j                         d
       |j                  d       | j                  |j                         d       |j                  d       | j                  |j                         d       |j                  d       | j                  |j                         d       |j                  d       y Nr   12345endr3   r   2r#  r   41234234   2345r   insertassertFalseselection_presentselection_ranger    selection_get
assertTrueselection_fromselection_toselection_clearselection_adjustr   s     r   test_selection_methodsz EntryTest.test_selection_methods  s   a!1134q%(--/90023a A--/5q!$--/5 1134q%("--/8"--/7"--/8"--/9"r   N)r"   r<   r=   ro   r   rR  rW  rZ  r_  ra  rf  ri  rq  rt  r  r?   r   r   r<  r<  U  sC    G2;J@1
;->
F
/
#r   r<  c                   h    e 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)SpinboxTest),r   rB   rC   buttonbackgroundbuttoncursorbuttondownreliefbuttonupreliefr   rD   r=  r   r>  rx   ry   formatfromrF   rG   rH   	incrementr?  r@  rA  rB  rC  rD  r   rL   rE  r   r   rF  rG  rH  r   rN   r   torJ  rK  r4  rP   wraprL  c                 B    t        j                  | j                  fi |S r   )rR   SpinboxrT   rU   s     r   r   zSpinboxTest.create      tyy3F33r   Nc                 H    | j                         }| j                  |d       y )Nr  rP  r   s     r   test_configure_buttonbackgroundz+SpinboxTest.test_configure_buttonbackground  s    V%78r   c                 H    | j                         }| j                  |d       y )Nr  r   checkCursorParamr   s     r   test_configure_buttoncursorz'SpinboxTest.test_configure_buttoncursor      fn5r   c                 H    | j                         }| j                  |d       y )Nr  r   checkReliefParamr   s     r   test_configure_buttondownreliefz+SpinboxTest.test_configure_buttondownrelief  s    f&89r   c                 H    | j                         }| j                  |d       y )Nr  r  r   s     r   test_configure_buttonupreliefz)SpinboxTest.test_configure_buttonuprelief  s    f&67r   c                    | j                         }| j                  |dd       | j                  |dd       | j                  |dd       | j                  |dd       | j                  |dd       | j                  |dd       | j                  |dd       | j                  |dd	       | j                  |dd
       | j                  |dd       | j                  |dd       | j                  |dd       y )Nr  z%2fz%2.2fz%.2fz%2.fz%2e-1fz2.2z%2.-2fz%-2.02fz% 2.02fz	% -2.200fz%09.200fz%dr   r[   r$   r   s     r   test_configure_formatz!SpinboxTest.test_configure_format  s    %0'2&1&1vx:vx7vx:)4)4+6*5vx6r   c                     | j                         }| j                  |dd       | j                  |dddd       | j                  |ddd	       y )
Nr  g      Y@r  ffffff$@ffffff'@   *-to value must be greater than -from valuer   r   r[   checkFloatParamr$   r   s     r   test_configure_fromzSpinboxTest.test_configure_from  sP    e,VVS$=vvsC 	 	Er   c           	      R    | j                         }| j                  |dddddd       y )Nr  r3   r  g)@r   r   r  r   s     r   test_configure_incrementz$SpinboxTest.test_configure_increment  s'    V["atQGr   c                     | j                         }| j                  |dd       | j                  |dddd       | j                  |ddd	       y )
Nr  g      Yr  r  r  r  i8r  r   r  r   s     r   test_configure_tozSpinboxTest.test_configure_to  sP    /VT3d;vtTC 	 	Er   c                     | j                         }| j                  |d   d       | j                  |dd       | j                  |ddd       | j                  |ddd       | j                  |dd       y )Nr4  r,   zmon tue wed thur)montuewedthurr   )*   gQ	@r,   r   z42 3.14 {} {any string})r   r    r[   r   s     r   test_configure_valuesz!SpinboxTest.test_configure_values  sy    )2.*<=*G!3 	 	5*F!: 	 	<"-r   c                 H    | j                         }| j                  |d       y )Nr  r   checkBooleanParamr   s     r   test_configure_wrapzSpinboxTest.test_configure_wrap      vv.r   c                    | j                         }| j                  |j                  d             | j                  t        j
                  |j                  d       | j                  t        j
                  |j                  d        | j                  t        |j                         | j                  t        |j                  dd       y )Nr   noindexr3   )r   assertIsBoundingBoxbboxr  rR   r   	TypeErrorr   s     r   	test_bboxzSpinboxTest.test_bbox	  s      Q0'**FKKC'**FKK>)V[[1)V[[!Q7r   c                    | j                         }|j                  dd       | j                  |j                                |j	                  dd       | j                  |j                         d       | j                  |j                                |j                  d       |j                  d       | j                  |j                         d       |j	                  dd       | j                  |j                         d	       |j                          | j                  |j                                |j	                  dd       |j                  d       | j                  |j                         d
       |j                  d       | j                  |j                         d       |j                  d       | j                  |j                         d       |j                  d       | j                  |j                         d       y rv  r  r   s     r   r  z"SpinboxTest.test_selection_methods  s   a!1134q%(--/90023a A--/5q!$--/5 1134q%("--/8"--/7"--/8"--/9r   c                 (   | j                         }| j                  |j                         d       |j                  d       | j                  |j                         d       |j                  d       | j                  |j                         d       y )Nrp  buttonup
buttondown)r   r    selection_elementr   s     r   test_selection_elementz"SpinboxTest.test_selection_element)  st    113V<  ,113Z@  .113\Br   )r"   r<   r=   ro   r   rf  r  r  r  r  r  r  r  r  r  r  r  r  r  r?   r   r   r  r    s[    G"4 96:87EHE	./8:0Cr   r  c                       e Zd ZdZd Zd Zd Zd Zd Zd Z	d Z
 ed	d
      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)TextTest))autoseparatorsrB   blockcursorrC   rD   endliner>  rx   ry   rE   rF   rG   rH   inactiveselectbackgroundr?  r@  rA  rB  insertunfocussedrC  maxundorJ   rK   rL   rF  rG  rH  setgridspacing1spacing2spacing3	startliner   tabstabstylerN   undorP   r  rL  yscrollcommandc                 B    t        j                  | j                  fi |S r   )rR   TextrT   rU   s     r   r   zTextTest.createB      ||DII000r   c                 H    | j                         }| j                  |d       y )Nr  r  r   s     r   test_configure_autoseparatorsz&TextTest.test_configure_autoseparatorsE      v'78r   c                 H    | j                         }| j                  |d       y )Nr  r  r   s     r   test_configure_blockcursorz#TextTest.test_configure_blockcursorI      v}5r   c                 ~   | j                         }dj                  d t        d      D              }|j                  d|       | j	                  |ddd       | j	                  |dd	d       | j                  |dd
d       | j	                  |dd       | j	                  |dd       | j                  |ddd       y )N
c              3       K   | ]  }d   ywzLine %dNr?   .0r   s     r   	<genexpr>z2TextTest.test_configure_endline.<locals>.<genexpr>O       7q7   r  rx  r  r  r,   r   r  r  expected integer but got "spam"r   rV  r     
   1-startline must be less than or equal to -endliner   joinr   r  r[   r$   r&   r'   r|   s      r   test_configure_endlinezTextTest.test_configure_endlineM  s    yy7E#J77eT"	3<	3<vy&8 	 	:	2.R0vy"J 	 	Lr   c                     | j                         }| j                  |ddddd       | j                  |ddd       | j                  |dd	d       y )
NrE   r  LY@fffffY@3cr  r3   r   r   r'  r   s     r   r  zTextTest.test_configure_heightZ  sM    fhUE4H$;!a8r   c                 N    | j                         }| j                  |dddd       y )Nr  r   r}  r  r   r  r   s     r   test_configure_maxundozTextTest.test_configure_maxundo`  s#    vy!Q;r   c                 H    | j                         }| j                  |d       y )Nr  rP  r   s     r   'test_configure_inactiveselectbackgroundz0TextTest.test_configure_inactiveselectbackgroundd  s    V%?@r      r   c                 N    | j                         }| j                  |dddd       y )Nr  hollowrp  solidr   r   s     r   test_configure_insertunfocussedz(TextTest.test_configure_insertunfocussedh  s'    F$6$fg	7r   c           	      T    | j                         }| j                  |dddddd       y )NrG  r   r   r   r   Fr  r   r   s     r    test_configure_selectborderwidthz)TextTest.test_configure_selectborderwidthn  s0    f&9!3E 	 	?r   c                 z    | j                         }| j                  |ddddd       | j                  |ddd       y )	Nr     ffffff5@皙6@0.5cr   r   r'  r   s     r   test_configure_spacing1z TextTest.test_configure_spacing1s  s9    fj"dD&I
B;r   c                 z    | j                         }| j                  |ddddd       | j                  |ddd       y )	Nr  r}  皙@ffffff@z0.1cr  r   r   r'  r   s     r   test_configure_spacing2z TextTest.test_configure_spacing2x  s9    fj!S#vF
B;r   c                 z    | j                         }| j                  |ddddd       | j                  |ddd       y )	Nr  r  r  r  r  r  r   r   r'  r   s     r   test_configure_spacing3z TextTest.test_configure_spacing3}  s9    fj"dD&I
C!<r   c                 ~   | j                         }dj                  d t        d      D              }|j                  d|       | j	                  |ddd       | j	                  |dd	d       | j                  |dd
d       | j	                  |dd       | j	                  |dd       | j                  |ddd       y )Nr  c              3       K   | ]  }d   ywr  r?   r  s     r   r  z4TextTest.test_configure_startline.<locals>.<genexpr>  r  r  r  rx  r  r  r,   r   r  r  r  r   r  r  rV  F   r  r  r  s      r   test_configure_startlinez!TextTest.test_configure_startline  s    yy7E#J77eT"S2>S2>v{F8 	 	:R0	2.v{BJ 	 	Lr   c                 L    | j                         }| j                  |ddd       y Nr   r   r   r   r   s     r   ri  zTextTest.test_configure_state  !    FGZBr   c                     | j                         }| j                  |dd       | j                  |ddt        | j                        dk\  rdnd       | j                  |ddd       | j	                  |dd	d
       y )Nr  )r  g333334@1i2iz10.2 20.7 1i 2ir  r      )z10.2z20.7r   r!  r   z2c left 4c 6c center)2cr  4c6cr   r  zbad screen distance "spam"r   )r   r[   r   rT   r$   r   s     r   test_configure_tabszTextTest.test_configure_tabs  s    (@A(9$5dii$@J$N ":&B 	 	D 	(>!E 	 	Gvvv&B 	 	Dr   c                 L    | j                         }| j                  |ddd       y )Nr  tabularwordprocessorr   r   s     r   test_configure_tabstylez TextTest.test_configure_tabstyle  s!    FJ	?Kr   c                 H    | j                         }| j                  |d       y )Nr  r  r   s     r   test_configure_undozTextTest.test_configure_undo  r  r   c                     | j                         }| j                  |dd       | j                  |ddd       | j                  |ddd       y )NrP   r-  r.  r3   r   r   )r   r  r[   r   s     r   r/  zTextTest.test_configure_width  sG    vw4:Q7r   c                 N    | j                         }| j                  |dddd       y )Nr  charrp  wordr   r   s     r   r  zTextTest.test_configure_wrap  s#    FFFFFCr   c                    | j                         }| j                  |j                  d             | j                  |j                  d             | j	                  t
        j                  |j                  d       | j	                  t
        j                  |j                  d        | j	                  t        |j                         | j	                  t        |j                  dd       y )Nz1.1rx  r  )r   r  r  assertIsNoner  rR   r   r  r   s     r   r  zTextTest.test_bbox  s      U!34&++e,-'**FKKC'**FKK>)V[[1)V[[%?r   N)r"   r<   r=   ro   r   r  r  r  r  r  r  r   r  r
  r  r  r  r  ri  r'  r+  r-  r/  r  r  r?   r   r   r  r  2  s    G196L9<A A7 7
?
<
<
=
LC
DL/8D@r   r  c                       e Zd ZdZe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 edd      d        Zy)
CanvasTest)rB   rC   closeenoughconfinerD   rE   rF   rG   rH   r?  r@  rA  rB  rC  offsetrL   scrollregionrF  rG  rH  r   rN   rL  xscrollincrementr  yscrollincrementrP   Tc                 B    t        j                  | j                  fi |S r   )rR   CanvasrT   rU   s     r   r   zCanvasTest.create  r   r   c           	      \    | j                         }| j                  |dddddt               y )Nr6     333333@rY  r  )r   r  r   r   s     r   test_configure_closeenoughz%CanvasTest.test_configure_closeenough  s/    V]BS""' 	 	)r   c                 H    | j                         }| j                  |d       y )Nr7  r  r   s     r   test_configure_confinez!CanvasTest.test_configure_confine      vy1r   c                     | j                         }| j                  |d   d       | j                  |dddddddd	d
d       | j                  |dd       | j                  |dd       | j	                  |dd       y )Nr8  z0,0r   r   r   r   r   r   r   r   r   z10,20z#5,6r  )r   r    r   r[   r$   r   s     r   test_configure_offsetz CanvasTest.test_configure_offset  sz    )51T3c4dH	F'2&1vx8r   c                 6   | j                         }| j                  |dd       | j                  |ddd       | j                  |dd       | j                  |ddd       | j                  |dd	       | j                  |dd
       | j                  |dd       y )Nr9  z0 0 200 150)r   r   r     r   r,   r  zbad scrollRegion "spam"r   )r   r   r  r  )r   r   r  )r   r   r  rI  r   r  r   s     r   test_configure_scrollregionz&CanvasTest.test_configure_scrollregion  s    >0@!. 	 	03v~v&? 	 	Av~7JKv~{Cv~7JKr   c                 P    | j                         }| j                  |dddd       y )Nr   r   r   z0bad state value "{}": must be normal or disabledr   r   r   s     r   ri  zCanvasTest.test_configure_state  s,    FGZI 	 	Kr   c           
      T    | j                         }| j                  |ddddddd       y )Nr:  (   r   gD@gE@iz0.5ir   r   s     r   test_configure_xscrollincrementz*CanvasTest.test_configure_xscrollincrement  -    f&8 !T4f	>r   c           
      T    | j                         }| j                  |ddddddd       y )Nr;  r  r   ffffff&@g333333+@r  z0.1ir   r   s     r   test_configure_yscrollincrementz*CanvasTest.test_configure_yscrollincrement  rO  r   c                     dD ]-  } ||      }| j                  |j                  |d      |       / | j                  t        |d       y )N)bevelmiterr   )	joinstylerV  r  r    itemcgetr  r   )r&   r:  factoryrV  r   s        r   _test_option_joinstylez!CanvasTest._test_option_joinstyle  sO    2 	DI),AQZZ;7C	D 	(Gv>r   c                 4   dD ]-  } ||      }| j                  |j                  |d      d       / dD ]-  } ||      }| j                  |j                  |d      d       /  |dd	      }| j                  |j                  |d      d       | j                  |j                  |d
      d        |dd	      }| j                  |j                  |d      d       | j                  |j                  |d
      d       | j                  t        |d       y )N)r3   Tr5   trueyeson)smoothr_  r\  )r   Fr2   falsenooffr2   T   )r_  
splinesteprd  30rawr  rW  )r&   r:  rY  r_  r   s        r   _test_option_smoothzCanvasTest._test_option_smooth  s   7 	>Fv&AQZZ84f=	> : 	;Fv&AQZZ84c:	; 4B/Ax0&9A|4d;5R0Ax0%8A|4d;(GF;r   c           
         | j                         }|j                  dddd      }| j                  |j                  |      g d       | j                  |j	                  |      d       |j                  g d      }| j                  |j                  |      g d       | j                  |j	                  |      d	       |j                  d
d      }| j                  |j                  |      g d       | j                  |j	                  |      d       |j                  ddg      }| j                  |j                  |      g d       | j                  |j	                  |      d       | j                  t        |j                  ddd       | j                  t        |j                  g d       | j                  t        |j                  dddddd       | j                  t        |j                  g d       | j                  t        |j                  dd       | j                  t        |j                  ddg       | j                  t        |j                         | j                  t        |j                  g        y )Nr  rc  rU  r  )      4@      $@      N@      >@)   	   =      )   rp  ro     )      5@      &@     N@      ?@)r  r  >          rx  rw     )      6@      (@      O@      @@)rq  rr  ?   !      r  r     )      7@      *@     O@     @@)rz  r|  @   "   r  rc  rU  rM  rV  r  rc  rM  rV  rU  r  )r   create_rectangler    coordsr  r  r   
IndexError)r&   r:  i1i2i3i4s         r   test_create_rectanglez CanvasTest.test_create_rectangle  s   KKMBB/"'?@_5 01"'?@%56(3"'?@%568 45"'?@%56(A$6$6BC(A$6$6E(A$6$6BBBO(A$6$68PQ(A$6$6B?(A$6$6RA*a&8&89*a&8&8"=r   c           	      r   | j                         j                  dddddd      }| j                  j                  |      g d       | j                  j	                  |      d       | j                  j                  |d	      d
       | j                  j                  |d      d       | j                  j                  |d      d       | j                  j                  |d      d       | j                  j                  |d      d       | j                  j                  |d      d       j                  g d      }| j                  j                  |      g d       | j                  j	                  |      d       j                  ddd      }| j                  j                  |      g d       | j                  j	                  |      d       j                  g d      }| j                  j                  |      g d       | j                  j	                  |      d       | j                  t        j                  ddd       | j                  t        j                  g d        | j                  t        j                  dd       | j                  t        j                  ddg       | j                  t        j                         | j                  t        j                  g        d!D ]:  }j                  dddd|"      }| j                  j                  |d	      |       < j                  ddddd#g d$%      }| j                  j                  |d      d&       | j                  t        j                  ddddd'"       d(D ]:  }j                  dddd|)      }| j                  j                  |d      |       < | j                  t        j                  ddddd')       | j                  fd*       | j                  fd+       y ),Nr  rc  rM  rV  rU  r  ri  rl        D@      I@rk  rj     r  rw  4   arrowrp  
arrowshapez8 10 3capstylebuttrV  r   r_  r2   rd  12rq  rp  )   3   ro  rr  rs  rv  g     D@g     I@ru  rt  )rm  rn  r  5   ry  r  r  r{  r}  r  g      E@g      J@r  r~  )r  r  r  6   r  )+   r  r  r  r  g     E@g     J@r  r  )rq  rr  A   7   r  )rp  firstlastboth)r  r  )r  r  r}  )r  r  z10 15 5r  )r  
projectingr   )r  c                  (     j                   di | S Nr  create_linerV   r:  s    r   <lambda>z-CanvasTest.test_create_line.<locals>.<lambda>Y  s    !P!P r   c                  (     j                   di | S )N)r  rc  rU  r  r  r  s    r   r  z-CanvasTest.test_create_line.<locals>.<lambda>[  s    !H!H r   )r   r  r    r  r  rX  r  r   r  rZ  rg  )	r&   r  r  r  r  r  r   r  r:  s	           @r   test_create_linezCanvasTest.test_create_line-  ss   KKM]]2r2r2r2"'KL_5B0&9B5x@B
3V<B4g>B137B5t<]]34"'KL_5]]8Xx8"'KL%56]]9:"'KL%56(AMM2r2>(AMM<@(AMM2r:(AMMB8<*amm4*ammR84 	<Eb"b"E:AQZZ73U;	< MM"b"bKMPA|4i@(AMM2r2rP5 	BHb"b"x@AQZZ:6A	B 	(AMM2r2rFS##AP	R  H	Jr   c                    | j                         j                  dddddd      }| j                  j                  |      g d       | j                  j	                  |      d       | j                  j                  |d	      d
       | j                  j                  |d      d       | j                  j                  |d      d       j                  g d      }| j                  j                  |      g d       | j                  j	                  |      d       j                  ddd      }| j                  j                  |      g d       | j                  j	                  |      d       j                  g d      }| j                  j                  |      g d       | j                  j	                  |      d       | j                  t        j                  ddd       | j                  t        j                  g d       | j                  t        j                         | j                  t        j                  g        | j                  fd       | j                  fd       y )Nr  rc  rM  rV  rU  r  r  )rm  rn  ro  r  rV  r   r_  r2   rd  r  r  r  )r  r  rw  r  ry  r  r{  r  )rq  rr  r  r  r  r  )rz  r|  r  r  r  c                  (     j                   di | S r  create_polygonr  s    r   r  z0CanvasTest.test_create_polygon.<locals>.<lambda>x      !1!1!1!SF!S r   c                  (     j                   di | S r  r  r  s    r   r  z0CanvasTest.test_create_polygon.<locals>.<lambda>z  r  r   )r   r  r    r  r  rX  r  r   r  rZ  rg  )r&   r  r  r  r  r:  s        @r   test_create_polygonzCanvasTest.test_create_polygon]  s    KKMb"b"b"5"'KL_5B4g>B137B5t<67"'KL%56h(;"'KL%56<="'KL%56(A$4$4b"bA(A$4$4lC*a&6&67*a&6&6;##AS	U  S	Ur   c           	         | j                         }|j                  ddddddd      }| j                  |j                  |      g d	       | j                  |j                  d      g d	       | j                  |j	                  |      d
       |j                  |dddddd       | j                  |j                  |      g d       | j                  |j	                  |      d       |j                  |g d       | j                  |j                  |      g d       |j                  |ddd       | j                  |j                  |      g d       |j                  |g d       | j                  |j                  |      g d       |j                  |dddd       | j                  |j                  |      g d       | j                  |j	                  |      d       | j                  t        |j                  |ddd       | j                  t        |j                  |g d       | j                  t        |j                  |dd       | j                  t        |j                  |ddg       |j                  |dddd       |j                  |      }| j                  |t               | j                  t        |      d       | j                  |d    d       t        d      D ]  }| j                  ||   t                y )!Nr  rc  rM  rV  rU  r  r   tagsr  r  r  P   Z   )r  rk  g     Q@g      T@g     V@r  )0   &   \   R   r  r  ry  r  r{  r  r  r  )ri  rl  rk  rj  )r  r  rw  rx  r  2030c60ir   r   r   )r   r  r    r  r  r  r   assertIsInstancelistr   r   r   )r&   r:  r   r  s       r   test_coordszCanvasTest.test_coords|  sg   KKMMM"b"b"bsM;!&JK#(LMO4	BBB+!&JK$45	,-!&JK	Hh1!&JK	23!&JK	BB#!&>?O4(AHHaR<(AHHa>(AHHaR8(AHHa"b:	D%.!fd+Va(B'q 	4A!!&)U3	4r   r  r   c                 D   | j                         }|j                  ddddd      }|j                  ddddd      }|j                  |      \  }}}}|j                  |      \  }}}}|j                  ddd	       |j                  |      \  }	}
}}|j                  |      \  }}}}| j	                  |	d       | j	                  |
d	       | j	                  ||z
  ||	z
         | j	                  ||z
  ||
z
         |j                  ||       |j                  dd
       |j                  |      \  }}}}|j                  |      \  }}}}| j	                  |d       | j	                  ||       | j	                  ||	z
  ||z
         | j	                  ||
z
  ||z
         y )Nr3   r  groupr  rc  rV  r  r  r  )y)r   r  r  movetor    	tag_lower)r&   r'   r  r  x1y1_x2y2x1_2y1_2x2_2y2_2x1_3y1_3x2_3y2_3s                    r   test_movetozCanvasTest.test_moveto  s   $$Q2r$@$$RR'$B{{2B1{{2B1gsC(!;;r?dAq!;;r?dAqs#s#b$+.b$+.R g$!;;r?dAq!;;r?dAqr"t$dTk2dTk2r   N)r"   r<   r=   ro   r   r   
_stringifyr   rB  rD  rG  rJ  ri  rN  rR  rZ  rg  r  r  r  r  r   r  r?   r   r   r5  r5    s|    G LJ3)
29
LK
>
>
?<>6.J`U>#4J A3 3r   r5  c                       e Zd ZdZd Zd Z  eddd      ej                        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)ListboxTest)activestylerB   rC   rD   r   r>  rx   ry   rE   rF   rG   rH   r   listvariablerL   rF  rG  rH  
selectmoder  r   rN   rP   rL  r  c                 B    t        j                  | j                  fi |S r   )rR   ListboxrT   rU   s     r   r   zListboxTest.create  r  r   c                 N    | j                         }| j                  |dddd       y )Nr  dotboxrp  r   r   r   s     r   test_configure_activestylez&ListboxTest.test_configure_activestyle  s&    FM$fk	;r   r  r   r}  c                     | j                         }t        j                  | j                        }| j	                  |d|       y )Nr  )r   rR   	DoubleVarrT   checkVariableParam)r&   r'   vars      r   test_configure_listvariablez'ListboxTest.test_configure_listvariable  s3    		*<r   c                     | j                         }| j                  |dd       | j                  |dd       | j                  |dd       | j                  |dd       y )Nr  singlebrowsemultipleextendedre  r   s     r   test_configure_selectmodez%ListboxTest.test_configure_selectmode  sM    h7h7j9j9r   c                 L    | j                         }| j                  |ddd       y r  r   r   s     r   ri  z ListboxTest.test_configure_state  r  r   c                    | j                         }| j                  t        d      5  |j                  d       d d d        dj	                         } |j
                  dg|  t        |      D ]  \  }}|j                  ||        | j                  t              5  |j                          d d d        | j                  t        d      5  |j                  d       d d d        t        | j                        dk\  rd	}nd
}| j                  |j                  dd      g |d       | j                  |j                  dd      g |d       | j                  |j                  dd      g |d       |j                  d      }| j                  |t               |j                         D ]v  \  }}| j                  t!        |      d       t!        |      dk(  s0| j                  ||j                  d|             | j                  |d   |j#                  d|             x y # 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   gxY w)Nzitem number "0" out of ranger   z)red orange yellow green blue white violetrx  )rB   zbad listbox index "red"redr"  )rB   r,   r,   r,   )rB   rB   
Backgroundr,   rB   violetz@0,0)r   r}  r}  r   )r   r6  r   itemconfiguresplitr  	enumerater  r  r   rT   r    r  dictitemsassertInr   rX  )	r&   r'   colorsr   colorprefixdkr   s	            r   test_itemconfigurezListboxTest.test_itemconfigure  s   ##H.LM 	$  #	$<BBDe%f%!&) 	6HAu  u 5	6y) 	#  "	###H.GH 	(  '	(TYY':5/FCF--a>)6)5)	+--e\B,6,8,	.--flC)6)5)	+   #a&GGI 	>DAqMM#a&&)1v{  F$8$8A$>?  1vq!'<=		>/	$ 	$	# 	#	( 	(s#   H+H8I+H58IIc                    | j                         }|j                  ddddd        |j                  d
i ||i | j                  |j                  d|      d   |       | j                  |j	                  d|      |       | j                  t        d      5   |j                  d
i |d	i d d d        y # 1 sw Y   y xY w)Nrx  r9  r   r:  r	  r   r   zunknown color name "spam"r  )r   )r   r  r   r    rX  r6  r   )r&   r   r   r'   s       r   check_itemconfigurezListboxTest.check_itemconfigure  s    eS#sC004-0--a6q95AD159##H.IJ 	6 F  5tVn5	6 	6 	6s   B55B>c                 (    | j                  dd       y )NrB   #ff0000r  r7  s    r   test_itemconfigure_backgroundz)ListboxTest.test_itemconfigure_background        y9r   c                 (    | j                  dd       y )Nbgr  r  r7  s    r   test_itemconfigure_bgz!ListboxTest.test_itemconfigure_bg        y1r   c                 (    | j                  dd       y )Nfg#110022r  r7  s    r   test_itemconfigure_fgz!ListboxTest.test_itemconfigure_fg  r  r   c                 (    | j                  dd       y )Nry   r  r  r7  s    r   test_itemconfigure_foregroundz)ListboxTest.test_itemconfigure_foreground  r  r   c                 (    | j                  dd       y )NrF  r  r  r7  s    r   #test_itemconfigure_selectbackgroundz/ListboxTest.test_itemconfigure_selectbackground        !3Y?r   c                 (    | j                  dd       y )NrH  z#654321r  r7  s    r   #test_itemconfigure_selectforegroundz/ListboxTest.test_itemconfigure_selectforeground  r  r   c                 R   | j                         } |j                  dgd t        d      D          |j                          | j	                  |j                  d             | j                  |j                  d             | j                  |j                  d             | j                  t        |j
                  d       | j                  t        |j
                  d        | j                  t        |j
                         | j                  t        |j
                  dd       y )Nr   c              3   &   K   | ]	  }d |z    ywzel%dNr?   r  s     r   r  z'ListboxTest.test_box.<locals>.<genexpr>       4avz4   r  r  r  r  r3   )
r   r  r   r   r  r  r3  r  r   r  r&   lbs     r   test_boxzListboxTest.test_box  s    [[]		!545845
	  ,"''"+&"''"+&(BGGY7(BGGT2)RWW-)RWWa3r   c                 r   | j                         } |j                  dgd t        d      D          |j                  dt        j
                         |j                  dd       |j                  d       | j                  |j                         d       | j                  t        |j                  d       y )Nr   c              3   &   K   | ]	  }d |z    ywr$  r?   r  s     r   r  z0ListboxTest.test_curselection.<locals>.<genexpr>(  r%  r&  r  r   r   r   )r   r#  r   r   )r   r  r   r  rR   ENDselection_setr    curselectionr  r  r'  s     r   test_curselectionzListboxTest.test_curselection&  s    [[]		!545845
1gkk*
A
*L9)R__a8r   c                 T   | j                         } |j                  dgd t        d      D          | j                  |j	                  d      d       | j                  |j	                  d      d       | j                  |j	                  d      d       | j                  |j	                  d      d	       | j                  |j	                  d
      d	       | j                  |j	                  dd      d       | j                  |j	                  dd      d       | j                  |j	                  dd      d       | j                  |j	                  dd      d       | j                  t        |j                  d       | j                  t        |j                  d        | j                  t        |j                         | j                  t        |j                  dd       | j                  t        |j                  ddd       | j                  t        |j                  d       y )Nr   c              3   &   K   | ]	  }d |z    ywr$  r?   r  s     r   r  z'ListboxTest.test_get.<locals>.<genexpr>1  r%  r&  r  el0r#  el3rx  el7r,   r  r}  )r3  el4el5)r6  el6r4  r?   )r2  r  r3   r   r@  )r   r  r   r    r   r  r   r  r'  s     r   test_getzListboxTest.test_get/  s   [[]		!545845E*E*.B'R(1'<=5)+@A1r*1x0(BFFI6(BFFD1)RVV,(BFFE9=)RVVQ15(BFFC0r   N)r"   r<   r=   ro   r   r  r   r   test_configure_justifyr  r  ri  r  r  r  r  r  r  r  r!  r)  r/  r8  r?   r   r   r  r    s{    	G4;
 2[Aq12F2]2]^=
:C>>6:22:@@
491r   r  c                   \    e 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)	ScaleTest)r   rB   bigincrementrC   r   rD   digitsrx   ry   r  rF   rG   rH   r   lengthorientrL   r   r   
resolution	showvaluesliderlengthsliderreliefr   rN   tickintervalr  troughcolorr   rP   verticalc                 B    t        j                  | j                  fi |S r   )rR   ScalerT   rU   s     r   r   zScaleTest.createP  rt   r   c                 N    | j                         }| j                  |dddd       y )Nr<  g(@g7@r  r  r   s     r   test_configure_bigincrementz%ScaleTest.test_configure_bigincrementS  s#    V^T4Dr   c                 L    | j                         }| j                  |ddd       y )Nr=  r}  r   r   r   s     r   test_configure_digitszScaleTest.test_configure_digitsW  s!    vxA6r   c                     | j                         }t        | j                        dk\  rt        nt        }| j                  |dddd|       y )N)r  r   r  r  r  -@333333.@r  )r   r   rT   r   r   r  )r&   r'   r  s      r   r  zScaleTest.test_configure_from[  s?    )$))4
BuVVS$4Hr   c                 p    | j                         }| j                  |dd       | j                  |dd       y )Nr   r   r,   re  r   s     r   test_configure_labelzScaleTest.test_configure_label`  s-    6,r   c                 P    | j                         }| j                  |ddddd       y )Nr>     gffffff`@g33333`@5ir   r   s     r   test_configure_lengthzScaleTest.test_configure_lengthe  s%    fhUE4Hr   c                 P    | j                         }| j                  |ddddd       y )Nr@  g@r   g@r   r  r   s     r   test_configure_resolutionz#ScaleTest.test_configure_resolutioni  s%    V\33Cr   c                 H    | j                         }| j                  |d       y )NrA  r  r   s     r   test_configure_showvaluez"ScaleTest.test_configure_showvaluem  s    v{3r   c           	      R    | j                         }| j                  |dddddd       y )NrB  r  rQ  333333/@rA  3mr   r   s     r   test_configure_sliderlengthz%ScaleTest.test_configure_sliderlengthq  s*    fn $b$	8r   c                 H    | j                         }| j                  |d       y )NrC  r  r   s     r   test_configure_sliderreliefz%ScaleTest.test_configure_sliderreliefv  r  r   c           	          | j                         }| j                  |dddddt               | j                  |dddt        	       y )
NrD  r3   333333@r  r   r  r   r   )r   r  )r   r  r   r[   r   s     r   test_configure_tickintervalz%ScaleTest.test_configure_tickintervalz  sK    V^QS!"- 	 	/Q( 	 	*r   c           	      \    | j                         }| j                  |dddddt               y )Nr  i,  rN  rO  r  r  )r   r  r   r   s     r   r  zScaleTest.test_configure_to  s/    VT3dC"- 	 	/r   N)r"   r<   r=   ro   default_orientr   rJ  rL  r  rQ  rU  rW  rY  r]  r_  rb  r  r?   r   r   r;  r;  C  sP    G  N2E7I
-
ID48
6*/r   r;  c                   @    e Zd ZdZeZdZdZd Zd Z	d Z
d Zd Zd	 Zy
)ScrollbarTest)r   activereliefrB   rC   r   rD   elementborderwidthrF   rG   rH   jumpr?  rL   r   r   rN   rE  rP   TrF  c                 B    t        j                  | j                  fi |S r   )rR   	ScrollbarrT   rU   s     r   r   zScrollbarTest.create  s      5f55r   c                 H    | j                         }| j                  |d       y )Nrg  r  r   s     r   test_configure_activereliefz)ScrollbarTest.test_configure_activerelief  r  r   c                 P    | j                         }| j                  |ddddd       y )Nrh  ra  r%  r   1mr   r   s     r   !test_configure_elementborderwidthz/ScrollbarTest.test_configure_elementborderwidth  s&    f&:Cb$Or   c                 P    | j                         }| j                  |dddd       y )Nr?  rF  
horizontalz4bad orientation "{}": must be vertical or horizontalr   r   r   s     r   test_configure_orientz#ScrollbarTest.test_configure_orient  s,    FHj,M 	 	Or   c                 8   | j                         }dD ]3  }|j                  |       | j                  |j                         |       5 |j                  d       | j                  |j                                | j	                  t
        |j                  dd       y )N)arrow1sliderarrow2r,   ru  rw  )r   activater    r3  r  r  )r&   sbr   s      r   test_activatezScrollbarTest.test_activate  sv    [[]/ 	/AKKNR[[]A.	/ 	B"++-()R[[(HEr   c                    | j                         }|j                  dd       | j                  |j                         d       | j	                  t
        |j                  dd       | j	                  t
        |j                  dd       | j	                  t
        |j                  dd        | j	                  t        |j                  d       | j	                  t        |j                  ddd       y )	N皙?皙?)r|  r}  abcdefg333333?gffffff?g?)r   r   r    r   r  r   r  )r&   ry  s     r   test_setzScrollbarTest.test_set  s    [[]
sC:.(BFFE59(BFFC7(BFFC6)RVVS1)RVVS#s;r   N)r"   r<   r=   ro   r   r   r  rd  r   rm  rp  rs  rz  r  r?   r   r   rf  rf    s;    G LJN66PO
F<r   rf  c                   
   e Zd ZdZdZd Zd Zd Zd Zd Z	 e
dd	d
      d        Z e
dd	d
      d        Z e
dd	d
      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")#PanedWindowTest)rB   rC   rD   	handlepad
handlesizerE   opaqueresizer?  proxybackgroundproxyborderwidthproxyreliefrL   
sashcursorsashpad
sashrelief	sashwidth
showhandlerP   rr  c                 B    t        j                  | j                  fi |S r   )rR   PanedWindowrT   rU   s     r   r   zPanedWindowTest.create  r   r   c           	      R    | j                         }| j                  |dddddd       y )Nr  r}  r  r  rA  ro  r   r   s     r   test_configure_handlepadz(PanedWindowTest.test_configure_handlepad  s'    fk1c3DIr   c           
      V    | j                         }| j                  |ddddddd       y )	Nr  r  g"@g333333%@rA  2mFr  r   r   s     r   test_configure_handlesizez)PanedWindowTest.test_configure_handlesize  s1    flAsD"d#( 	 	*r   c                 X    | j                         }| j                  |dddddddd		       y )
NrE   r  r  r  r  r   r   Fr  r   r   s     r   r  z%PanedWindowTest.test_configure_height  s3    fhUE4D#( 	 	*r   c                 H    | j                         }| j                  |d       y )Nr  r  r   s     r   test_configure_opaqueresizez+PanedWindowTest.test_configure_opaqueresize  s    v~6r   r  r   r}  c                 H    | j                         }| j                  |d       y )Nr  rP  r   s     r   test_configure_proxybackgroundz.PanedWindowTest.test_configure_proxybackground  s    V%67r   c                 X    | j                         }| j                  |dddddddd		       y )
Nr  r   r   g333333@r   r   r   Fr  r   r   s     r   test_configure_proxyborderwidthz/PanedWindowTest.test_configure_proxyborderwidth  s5    f&8c1b%#( 	 	*r   c                 H    | j                         }| j                  |d       y )Nr  r  r   s     r   test_configure_proxyreliefz*PanedWindowTest.test_configure_proxyrelief  s    fm4r   c                 H    | j                         }| j                  |d       y )Nr  r  r   s     r   test_configure_sashcursorz)PanedWindowTest.test_configure_sashcursor      fl3r   c           	      R    | j                         }| j                  |dddddd       y )Nr  r  r   r   r   r  r   r   s     r   test_configure_sashpadz&PanedWindowTest.test_configure_sashpad  s'    fiCb$Gr   c                 H    | j                         }| j                  |d       y )Nr  r  r   s     r   test_configure_sashreliefz)PanedWindowTest.test_configure_sashrelief  r  r   c           
      V    | j                         }| j                  |ddddddd       y )	Nr  r  g333333&@r[  rA  ro  Fr  r   r   s     r   test_configure_sashwidthz(PanedWindowTest.test_configure_sashwidth  s1    fk2tT2t#( 	 	*r   c                 H    | j                         }| j                  |d       y )Nr  r  r   s     r   test_configure_showhandlez)PanedWindowTest.test_configure_showhandle  s    v|4r   c                 X    | j                         }| j                  |dddddddd		       y )
NrP   r-  gfffff6y@gIy@r.  r   rT  Fr  r   r   s     r   r/  z$PanedWindowTest.test_configure_width  s3    fgsE5$4#( 	 	*r   c                     | j                         }t        j                  |      }t        j                  |      }|j                  |       |j                  |       |||fS r   )r   rR   r   addr&   pr   r:  s       r   create2zPanedWindowTest.create2  sJ    KKMNN1NN1	a	a!Qwr   c                    | j                         \  }}}| j                  t        |j                         |j                  |      }| j	                  |t
               |j                         D ]g  \  }}| j                  t        |      d       | j                  ||j                  ||             | j                  |d   |j                  ||             i y )Nr}  r   )
r  r  r  paneconfigurer  r  r  r    r   panecget)r&   r  r   r:  r	  r
  r   s          r   test_paneconfigurez"PanedWindowTest.test_paneconfigure  s    ,,.1a)Q__5OOAa&GGI 	5DAqSVQ'Q1 56QqT1::a#34	5r   c                     | j                   st        |      } |j                  |fi ||i | j                  |j                  ||      d   |       | j                  |j	                  ||      |       y )Nr   )r6   r   r  r    r  )r&   r  r   r   r   r   s         r   check_paneconfigurez#PanedWindowTest.check_paneconfigure  sf    8}H+dE]+D1!4h?At,h7r   c                     | j                  t        |      5   |j                  |fi |di d d d        y # 1 sw Y   y xY w)NbadValue)r6  r   r  )r&   r  r   r   msgs        r   check_paneconfigure_badz'PanedWindowTest.check_paneconfigure_bad   s?    ##Hc2 	5AOOA4$
!34	5 	5 	5s   6?c           	          | j                         \  }}}| j                  ||d|t        |             | j                  ||dd       y )Nafterbad window path name "badValue"r  r  r   r  r  s       r   test_paneconfigure_afterz(PanedWindowTest.test_paneconfigure_after$  sE    ,,.1a  Aw3q6:$$Q7%F	Hr   c           	          | j                         \  }}}| j                  ||d|t        |             | j                  ||dd       y )Nbeforer  r  r  s       r   test_paneconfigure_beforez)PanedWindowTest.test_paneconfigure_before*  sE    ,,.1a  AxCF;$$Q8%F	Hr   c                 ~    | j                         \  }}}| j                  ||ddd       | j                  ||dd       y )NrE   r  bad screen distance "badValue"r  r  r  r  s       r   test_paneconfigure_heightz)PanedWindowTest.test_paneconfigure_height0  sA    ,,.1a  AxR8$$Q8%E	Gr   c                 ~    | j                         \  }}}| j                  ||ddd       | j                  ||dd       y )NhideFr   z)expected boolean value but got "badValue"r  r  s       r   test_paneconfigure_hidez'PanedWindowTest.test_paneconfigure_hide6  sA    ,,.1a  Avua8$$Q6%P	Rr   c                 ~    | j                         \  }}}| j                  ||ddd       | j                  ||dd       y )Nminsizer  r  r  r  s       r   test_paneconfigure_minsizez*PanedWindowTest.test_paneconfigure_minsize<  sA    ,,.1a  Ay"b9$$Q9%E	Gr   c                 ~    | j                         \  }}}| j                  ||ddd       | j                  ||dd       y )NrJ   r   r3   r  r  r  s       r   test_paneconfigure_padxz'PanedWindowTest.test_paneconfigure_padxB  A    ,,.1a  AvsA6$$Q6%E	Gr   c                 ~    | j                         \  }}}| j                  ||ddd       | j                  ||dd       y )NrK   r   r3   r  r  r  s       r   test_paneconfigure_padyz'PanedWindowTest.test_paneconfigure_padyH  r  r   c                 ~    | j                         \  }}}| j                  ||ddd       | j                  ||dd       y )Nstickynsewneswz[bad stickyness value "badValue": must be a string containing zero or more of n, e, s, and wr  r  s       r   test_paneconfigure_stickyz)PanedWindowTest.test_paneconfigure_stickyN  sB    ,,.1a  Ax@$$Q8&6	7r   c                 ~    | j                         \  }}}| j                  ||ddd       | j                  ||dd       y )NstretchalwalwayszEbad stretch "badValue": must be always, first, last, middle, or neverr  r  s       r   test_paneconfigure_stretchz*PanedWindowTest.test_paneconfigure_stretchV  sD    ,,.1a  Ay%B$$Q9&M	Nr   c                 ~    | j                         \  }}}| j                  ||ddd       | j                  ||dd       y )NrP   r  r  r  r  s       r   test_paneconfigure_widthz(PanedWindowTest.test_paneconfigure_width]  sA    ,,.1a  AwB7$$Q7%E	Gr   N)"r"   r<   r=   ro   rd  r   r  r  r  r  r   r  r  r  r  r  r  r  r  r/  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r?   r   r   r  r    s    G "N8J*
*
7 Aq8 8 Aq* * Aq5 54H4*
5*
585HHGRGGG7NGr   r  c                   P    e 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)MenuTest)r   activeborderwidthr   rB   rC   rD   r   rx   ry   postcommandrL   r   rN   tearofftearoffcommandr#   typeFc                 B    t        j                  | j                  fi |S r   )rR   rZ   rT   rU   s     r   r   zMenuTest.createo  r  r   c                 h    | j                         }|j                  d      }| j                  |       y )Nrp  )r   indexr3  )r&   r'   r   s      r   test_indexcommand_nonezMenuTest.test_indexcommand_noner  s)    LL !r   c                 H    | j                         }| j                  |d       y )Nr  r]  r   s     r   test_configure_postcommandz#MenuTest.test_configure_postcommandw  r  r   c                 H    | j                         }| j                  |d       y )Nr  r  r   s     r   test_configure_tearoffzMenuTest.test_configure_tearoff{  rE  r   c                 H    | j                         }| j                  |d       y )Nr  r]  r   s     r   test_configure_tearoffcommandz&MenuTest.test_configure_tearoffcommand  r  r   c                 J    | j                         }| j                  |dd       y )Nr#   r   re  r   s     r   test_configure_titlezMenuTest.test_configure_title  s    6r   c           	          | j                         }|j                         dk  rdnd}| j                  |ddddd|z   	       y )
N)r     znormal, tearoff, or menubarzmenubar, normal, or tearoffr  r   r  menubarzbad type "{}": must be r   )r   info_patchlevelr   )r&   r'   optss      r   test_configure_typezMenuTest.test_configure_type  sT    ))+f4 .- 	 	Fi,t3 	 	r   c                    | j                         }|j                  d       | j                  t        |j                         | j                  t        d      5  |j	                  d       d d d        |j	                  d      }| j                  |t               |j                         D ]  \  }}| j                  |t               | j                  |t               | j                  t        |      d       | j                  |d   |       | j                  |j                  d|      |d           |j                          y # 1 sw Y   xY w)	Nr   r   zbad menu entry index "foo"r   r3   r}  r   r   )r   add_commandr  r  entryconfigurer6  r   r  r  r  r   tupler    r   	entrycgetr   )r&   m1r	  r
  r   s        r   test_entryconfigurezMenuTest.test_entryconfigure  s   [[]
V$)R%6%67##H.JK 	%e$	%a a&GGI 	7DAq!!!S)!!!U+SVQ'QqT1%R\\!Q/16	7 	

	% 	%s   EEc                     | j                         }|j                  d       | j                  |j                  dd      d       |j	                  dd       | j                  |j                  dd      d       y )Nr   r  r3   r   changed)r   r  r    r  r  )r&   r  s     r   test_entryconfigure_labelz"MenuTest.test_entryconfigure_label  sd    [[]
V$a16:
!9-a19=r   c                    | j                         }t        j                  | j                        }t        j                  | j                        }|j	                  |ddd       | j                  t        |j                  dd            t        |             |j                  d|       | j                  t        |j                  dd            t        |             y )NTFNonsense)r   r   r   r   r3   r   )r   )	r   rR   
BooleanVarrT   add_checkbuttonr    r   r  r  )r&   r  v1v2s       r   test_entryconfigure_variablez%MenuTest.test_entryconfigure_variable  s    [[]		*		*
Bu!+ 	 	-R\\!Z893r7C
!b)R\\!Z893r7Cr   N)r"   r<   r=   ro   r   r   r  r  r  r  r  r  r  r  r  r?   r   r   r  r  d  sC    G L1
6297	 >Dr   r  c                        e Zd ZdZdZd Zd Zy)MessageTest)r   aspectrB   rC   rD   rx   ry   rF   rG   rH   r   rJ   rK   rL   rN   r|   r   rP   Fc                 B    t        j                  | j                  fi |S r   )rR   MessagerT   rU   s     r   r   zMessageTest.create  r  r   c                 N    | j                         }| j                  |dddd       y )Nr	     r   ir   r   s     r   test_configure_aspectz!MessageTest.test_configure_aspect  s#    vxa>r   N)r"   r<   r=   ro   r>   r   r  r?   r   r   r  r    s    G 4?r   r  c                       e Zd Zd Zd Zy)DefaultRootTestc                 B    | j                  t        j                         y r   )_test_widgetrR   rs   r7  s    r   
test_framezDefaultRootTest.test_frame      '--(r   c                 B    | j                  t        j                         y r   )r  rR   r   r7  s    r   
test_labelzDefaultRootTest.test_label  r  r   N)r"   r<   r=   r  r  r?   r   r   r  r    s    ))r   r  __main__),unittestrR   r   rc   test.supportr   test.test_tkinter.supportr   r   r   r   test.test_tkinter.widget_testsr	   r
   r   r   r   r   r   TestCaserA   rq   rw   r   r   r   r   r   r  r1  r<  r  r  r5  r  r;  rf  r  r  r  r  	tests_guir"   mainr?   r   r   <module>r     s      	 !; ;P P 	"7-~ "7J *+'2'):): '2 ,'2T *+	2$h&7&7 	2 ,	2 *+)8+<+<  ,69*,< 9 *+2!8#4#4 2 ,2 *+O"H$5$5 O ,O( *+3%'):): 3% ,3%l *+D'):): D ,D, *+=H&(9(9 =H ,=H@?^X%6%6 ? &(<=X#"H$5$5 X# >X#v *+}C)X.. }C ,}C@ *+E@!8#4#4 E@ ,E@P n&:;z3#X%6%6 z3 <z3z &(<=F1$h&7&7 F1 >F1R n&:;@/"H$5$5 @/ <@/F n&:;/<&(9(9 /< </<d *+fG((*;*; fG ,fGR *+LD!8#4#4 LD ,LD^ n&:;?$h&7&7 ? <?$)-x/@/@ ) 	J>)[+~)]X|_	 zHMMO r   