
    ;bhp                        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
mZ d dlmZmZmZmZmZ  ed       dZdZ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 d0 d1ee j,                               Z) eee       G d2 d3ee j,                               Z* G d4 d5e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-d6k(  r e j\                          yy)7    N)TclError)requires)requires_tk
tk_versionget_tk_patchlevel	widget_eqAbstractDefaultRootTest)add_standard_optionsAbstractWidgetTestStandardOptionsTestsIntegerSizeTestsPixelSizeTestsguiz.(bad|expected) screen distance (but got )?"{}"z4(bad|expected) screen distance (or "" but got )?"{}"c                 *    t        t        |             S N)floatround)xs    H/opt/python-3.12.12/usr/lib/python3.12/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r2   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   )r:   r/   r&   s      r   test_configure_visualz*AbstractToplevelTest.test_configure_visual4   sd    )2.vxL 	 	N++Y+/*I6r   N)r#   
__module____qualname___conv_pad_pixelsr*   r0   r8   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backgroundimageborderwidthr   r,   r2   cursorheighthighlightbackgroundhighlightcolorhighlightthicknessmenupadxpadyreliefscreen	takefocustileuser:   widthc                 B    t        j                  | j                  fi |S r   )tkinterToplevelrootr'   kwargss     r   r    zToplevelTest.createG   s    		4V44r   c                     | j                         }t        j                  | j                        }| j	                  |d|t
               | j	                  |dd       y )NrK   eqr-   )r    rU   MenurW   
checkParamr   r'   r(   rK   s      r   test_configure_menuz ToplevelTest.test_configure_menuJ   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 X11rO   r-   DISPLAYzNo $DISPLAY set.z3can't modify -screen option after widget is createdr   )rO   )r    _windowingsystemskipTestr!   osenvironKeyErrorr%   )r'   r(   displayr)   s       r   test_configure_screenz"ToplevelTest.test_configure_screenP   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)NrR   r-   Tr5   )wid)rR   )r    r!   hexwinfo_idsubTest)r'   r(   parentrl   r)   s        r   test_configure_usezToplevelTest.test_configure_use^   s    +t,&//#$\\c\"kkck*GWU^S1 #""s   #(BBN)r#   r=   r>   OPTIONSr    r`   rj   rq   r@   r   r   rB   rB   =   s    G5,52r   rB   c                       e Zd ZdZd Zy)	FrameTest)rC   rD   rE   r   r,   r2   rF   rG   rH   rI   rJ   rL   rM   rN   rP   rQ   r:   rS   c                 B    t        j                  | j                  fi |S r   )rU   FramerW   rX   s     r   r    zFrameTest.createq       }}TYY1&11r   Nr#   r=   r>   rr   r    r@   r   r   rt   rt   h   s    G2r   rt   c                   "    e Zd ZdZd Zd Zd Zy)LabelFrameTest)rC   rE   r   r,   r2   rF   font
foregroundrG   rH   rI   rJ   labelanchorlabelwidgetrL   rM   rN   rP   textr:   rS   c                 B    t        j                  | j                  fi |S r   )rU   
LabelFramerW   rX   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 )Nr}   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    rU   LabelrW   r^   destroy)r'   r(   labels      r   test_configure_labelwidgetz)LabelFrameTest.test_configure_labelwidget   s@    diif5AuvFr   N)r#   r=   r>   rr   r    r   r   r@   r   r   rz   rz   u   s    G7@r   rz   c                   .    e Zd ZdZedk\  Zedk\  Zedk\  Zy)AbstractLabelTestF      N)r#   r=   r>   _conv_pixelsr   _clip_highlightthickness	_clip_pad_clip_borderwidthr@   r   r   r   r      s'    L)V3f$I"f,r   r   c                       e Zd ZdZd Zy)	LabelTest)activebackgroundactiveforegroundanchorrC   bitmaprE   compoundrF   disabledforegroundr{   r|   rG   rH   rI   rJ   imagejustifyrL   rM   rN   staterP   r   textvariable	underlinerS   
wraplengthc                 B    t        j                  | j                  fi |S r   )rU   r   rW   rX   s     r   r    zLabelTest.create   rw   r   Nrx   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   rC   r   rE   commandr   rF   r;   r   r{   r|   rG   rH   rI   rJ   r   r   
overreliefrL   rM   rN   repeatdelayrepeatintervalr   rP   r   r   r   rS   r   c                 B    t        j                  | j                  fi |S r   )rU   ButtonrW   rX   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>   rr   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   rC   r   rE   r   r   rF   r   r{   r|   rG   rH   rI   rJ   r   indicatoronr   	offreliefoffvalueonvaluer   rL   rM   rN   selectcolorselectimager   rP   r   r   tristateimagetristatevaluer   variablerS   r   c                 B    t        j                  | j                  fi |S r   )rU   CheckbuttonrW   rX   s     r   r    zCheckbuttonTest.create       ""499777r   c                 P    | j                         }| j                  |ddddd       y )Nr   r4   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   r4   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      )rangerU   rv   rW   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9AS:'	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   r4   r   )	rU   rv   rW   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>   rr   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   rC   r   rE   r   r   rF   r   r{   r|   rG   rH   rI   rJ   r   r   r   r   r   rL   rM   rN   r   r   r   rP   r   r   r   r   r   valuer   rS   r   c                 B    t        j                  | j                  fi |S r   )rU   RadiobuttonrW   rX   s     r   r    zRadiobuttonTest.create  r   r   c                 P    | j                         }| j                  |ddddd       y )Nr   r4   r   r-   r   r   r   s     r   test_configure_valuez$RadiobuttonTest.test_configure_value  s%    !S"lCr   N)r#   r=   r>   rr   r    r  r@   r   r   r   r      s    G8Dr   r   c                   D    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y
)MenubuttonTest)r   r   r   rC   r   rE   r   rF   	directionr   r{   r|   rG   rH   rI   rJ   r   r   r   rK   rL   rM   rN   r   rP   r   r   r   rS   r   TFc                 B    t        j                  | j                  fi |S r   )rU   
MenubuttonrW   rX   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 )NrG   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    rU   
PhotoImagerW   r^   r   assertRaisesr   r!   	exception	configure)r'   r(   r   r   cms        r   test_configure_imagez#MenubuttonTest.test_configure_image)  s    ""$))(CS9.w//0B$F7O 1S.7w//0Bgv./ 1S.7  10 10s   ,D DDDc                     | j                         }t        j                  |d      }| j                  |d|t               |j                          y )NrK   r   r[   )r    rU   r]   r^   r   r   r_   s      r   r`   z"MenubuttonTest.test_configure_menu7  s:    ||F0;r   c                 Z    | j                         }| j                  |ddddt               y )NrS     nr   r  r  r   s     r   test_configure_widthz#MenubuttonTest.test_configure_width=  s(    vwT13Gr   N)r#   r=   r>   rr   r   r   r   r   r   r    r  r  r   r`   r%  r@   r   r   r  r    sA    
G L#I7<
I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   )rU   
OptionMenurW   )r'   r;   valuesrY   s       r   r    zOptionMenuTest.createD  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   rU   r)  rW   r'   s    r   test_bad_kwargzOptionMenuTest.test_bad_kwargG  s8    ##H.HItyy$2> JIIs   $AAN)r   )ar   c)r#   r=   r>   r    r.  r@   r   r   r'  r'  B  s    O?r   r'  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)!rC   rE   rF   disabledbackgroundr   exportselectionr{   r|   rH   rI   rJ   insertbackgroundinsertborderwidthinsertofftimeinsertontimeinsertwidthinvalidcommandr   placeholderplaceholderforegroundreadonlybackgroundrN   selectbackgroundselectborderwidthselectforegroundshowr   rP   r   validatevalidatecommandrS   xscrollcommandc                 B    t        j                  | j                  fi |S r   )rU   EntryrW   rX   s     r   r    zEntryTest.create\  rw   r   c                 H    | j                         }| j                  |d       y )Nr3  r    checkColorParamr   s     r   !test_configure_disabledbackgroundz+EntryTest.test_configure_disabledbackground_      V%9:r   c           
          | j                  d      }| j                  |ddddddd	       | j                  |dd
d       y )Nr  )r9  r6  r   ?@   10p<   2   r   r    checkPixelsParamr^   r   s     r    test_configure_insertborderwidthz*EntryTest.test_configure_insertborderwidthc  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 )Nr9  rM  @rQ  g?r   r   rP  g?r4   rT  r   s     r   test_configure_insertwidthz$EntryTest.test_configure_insertwidthj  s_    fmS#uEsQ?rA>sQ?r   c                 l    | j                         }| j                  |d       | j                  |d       y )Nr:  invcmdr    checkCommandParamr   s     r   test_configure_invalidcommandz'EntryTest.test_configure_invalidcommandq  s.    v'78vx0r   c                 H    | j                         }| j                  |d       y )Nr=  rH  r   s     r   !test_configure_readonlybackgroundz+EntryTest.test_configure_readonlybackgroundv  rK  r   c                     | j                         }| j                  |dd       | j                  |dd       | j                  |dd       y )NrA  *r-    r    r^   r   s     r   test_configure_showzEntryTest.test_configure_showz  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 )NrB  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 )NrC  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endr4   r   2   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>   rr   r    rJ  rV  rY  r^  r`  re  rh  rp  rs  r  r@   r   r   r2  r2  L  sC    G2;J@1
;->
F
/
#r   r2  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   rC   rE   buttonbackgroundbuttoncursorbuttondownreliefbuttonupreliefr   rF   r3  r   r4  r{   r|   formatfromrH   rI   rJ   	incrementr5  r6  r7  r8  r9  r:  r   r;  r<  rN   r=  r   r   r>  r?  r@  r   rP   r   torB  rC  r*  rS   wraprD  c                 B    t        j                  | j                  fi |S r   )rU   SpinboxrW   rX   s     r   r    zSpinboxTest.create      tyy3F33r   Nc                 H    | j                         }| j                  |d       y )Nr  rH  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       t        dk\  r| j                  |ddd	
       y | j	                  |ddd       y )Nr  g      Y@r  ffffff$@ffffff'@r      r  r   *-to value must be greater than -from valuer   r    r^   checkFloatParamr   r%   r   s     r   test_configure_fromzSpinboxTest.test_configure_from  sp    e,VVS$=  s C""FCG # Ir   c           	      R    | j                         }| j                  |dddddd       y )Nr  r4   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       t        dk\  r| j                  |ddd	
       y | j	                  |ddd       y )Nr  g      Yr  r  r  r  r   i8r  r   r  r   r  r   s     r   test_configure_tozSpinboxTest.test_configure_to  sp    /VT3d;  td C""D$G # Ir   c                     | j                         }| j                  |d   d       | j                  |dd       | j                  |ddd       | j                  |ddd       | j                  |dd       y )Nr*  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   noindexr4   )r    assertIsBoundingBoxbboxr  rU   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 ru  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 )Nro  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>   rr   r    re  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	IH	I	./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))autoseparatorsrC   blockcursorrE   rF   endliner4  r{   r|   rG   rH   rI   rJ   inactiveselectbackgroundr5  r6  r7  r8  insertunfocussedr9  maxundorL   rM   rN   r>  r?  r@  setgridspacing1spacing2spacing3	startliner   tabstabstylerP   undorS   r  rD  yscrollcommandc                 B    t        j                  | j                  fi |S r   )rU   TextrW   rX   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       7JqJ   r  rw  r  r  r-   r   r  r  expected integer but got "spam"r   rS  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 )
NrG   r  LY@fffffY@3cr  r4   r   r   rT  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  rH  r   s     r   'test_configure_inactiveselectbackgroundz0TextTest.test_configure_inactiveselectbackgroundd  s    V%?@r   r   rO  c                 N    | j                         }| j                  |dddd       y )Nr  hollowro  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 )Nr?  rM  rN  rP  rQ  Fr  r    rU  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   rT  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   rT  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   rT  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  rw  r  r  r-   r   r  r  r  r   r  r  rS  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   rh  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	t
        j                  d	      
       y )Nr  )r  g333334@1i2iz10.2 20.7 1i 2ir   rO     )z10.2z20.7r   r!  r   z2c left 4c 6c center)2cr  4c6cr   r  r   )r    r^   r   rW   r%   EXPECTED_SCREEN_DISTANCE_ERRMSGr  r   s     r   test_configure_tabszTextTest.test_configure_tabs  s    (@A(9$5dii$@J$N ":&B 	 	D 	(>!E 	 	Gvvv6==fE 	 	G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 )NrS   r#  r$  r4   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  charro  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.1rw  r  )r    r  r  assertIsNoner  rU   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>   rr   r    r  r  r  r  r  r  r   r  r
  r  r  r  r  rh  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
G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)rC   rE   closeenoughconfinerF   rG   rH   rI   rJ   r5  r6  r7  r8  r9  offsetrN   scrollregionr>  r?  r@  r   rP   rD  xscrollincrementr  yscrollincrementrS   Tc                 B    t        j                  | j                  fi |S r   )rU   CanvasrW   rX   s     r   r    zCanvasTest.create  r   r   c           	      \    | j                         }| j                  |dddddt               y )Nr7     333333@rX  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 )Nr8  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 )Nr9  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 )Nr:  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  rJ  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   rh  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  rP  r   c                     dD ]-  } ||      }| j                  |j                  |d      |       / | j                  t        |d       y )N)bevelmiterr   )	joinstylerW  r  r!   itemcgetr  r   )r'   r0  factoryrW  r   s        r   _test_option_joinstylez!CanvasTest._test_option_joinstyle  sH    2I),AQZZ;7C 3 	(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)r4   Tr6   trueyeson)smoothr`  r]  )r   Fr3   falsenooffr3   T   )r`  
splinestepre  30rawr  rX  )r'   r0  rZ  r`  r   s        r   _test_option_smoothzCanvasTest._test_option_smooth  s    7Fv&AQZZ84f= 8 :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  rd  rR  r  )      4@      $@      N@      >@)   	   =      )   rq  rp     )      5@      &@     N@      ?@)r  r  >          ry  rx     )      6@      (@      O@      @@)rr  rs  ?   !      r  r     )      7@      *@     O@     @@)r{  r}  @   "   r  rd  rR  rN  rS  r  rd  rN  rS  rR  r  )r    create_rectangler!   coordsr  r  r   
IndexError)r'   r0  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  rd  rN  rS  rR  r  rj  rm        D@      I@rl  rk     r   rx  4   arrowro  
arrowshapez8 10 3capstylebuttrW  r   r`  r3   re  12rr  rq  )   3   rp  rs  rt  rw  g     D@g     I@rv  ru  rn  ro  r  5   rz  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  rr  rs  A   7   r  )ro  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rY   r0  s    r   <lambda>z-CanvasTest.test_create_line.<locals>.<lambda>Y  s    !P!Pr   c                  (     j                   di | S )N)r  rd  rR  r  r  r  s    r   r  z-CanvasTest.test_create_line.<locals>.<lambda>[  s    !H!Hr   )r    r  r!   r  r  rY  r  r   r  r[  rh  )	r'   r  r  r  r  r  r   r  r0  s	           @r   test_create_linezCanvasTest.test_create_line-  sg   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4Eb"b"E:AQZZ73U; 5 MM"b"bKMPA|4i@(AMM2r2rP5Hb"b"x@AQZZ:6A 6 	(AMM2r2rFS##AP	R  H	Jr   c           	      4   | j                         t        dk\  }j                  d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d	      }| j                  j	                  |      g d       | j                  j                  |      d       j                  dddd	      }| j                  j	                  |      g d       | j                  j                  |      d       j                  g d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   r  rd  rN  rS  rR  r  red)outliner  r  rW  r   r`  r3   re  r  r  r  r  rz  r  r|  r  r  r  r  r  r  c                  (     j                   di | S r  create_polygonr  s    r   r  z0CanvasTest.test_create_polygon.<locals>.<lambda>{      !1!1!1!SF!Sr   c                  (     j                   di | S r  r  r  s    r   r  z0CanvasTest.test_create_polygon.<locals>.<lambda>}  r  r   )r    r   r  r!   r  r  rY  r  r   r  r[  rh  )r'   tk87r  r  r  r  r0  s         @r   test_create_polygonzCanvasTest.test_create_polygon]  s   KKMV# b"b"b"eD"'KL_5B4g>B137B5t<6F"'KL_5h(EJ"'KL%56<eL"'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  rd  rN  rS  rR  r  r   tagsr  r  r  P   Z   )r  rl  g     Q@g      T@g     V@r  )0   &   \   R   r  r  rz  r  r|  r  r  r  )rj  rm  rl  rk  )r  r   rx  ry  r  2030c60irQ  r   r   )r    r  r!   r  r  r  r   assertIsInstancelistr   r   r   )r'   r0  r   r  s       r   test_coordszCanvasTest.test_coords  sb   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A!!&)U3 r   r   rO  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 )Nr4   r  groupr  rd  rS  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>   rr   r   r   
_stringifyr    rC  rE  rH  rK  rh  rO  rS  r[  rh  r  r  r  r  r   r  r@   r   r   r6  r6    s}    G LJ3)
29
LK
>
>
?<>6.J` UD#4J A3 3r   r6  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)activestylerC   rE   rF   r   r4  r{   r|   rG   rH   rI   rJ   r   listvariablerN   r>  r?  r@  
selectmoder  r   rP   rS   rD  r  c                 B    t        j                  | j                  fi |S r   )rU   ListboxrW   rX   s     r   r    zListboxTest.create  r  r   c                 N    | j                         }| j                  |dddd       y )Nr  dotboxro  r   r   r   s     r   test_configure_activestylez&ListboxTest.test_configure_activestyle  s&    FM$fk	;r   r   rO  r}  c                     | j                         }t        j                  | j                        }| j	                  |d|       y )Nr  )r    rU   	DoubleVarrW   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extendedrd  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   rh  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 violetrw  )rC   zbad listbox index "red"r  r"  )rC   r-   r-   r-   )rC   rC   
Backgroundr-   rC   violetz@0,0)r   r}  r}  r   )r    r,  r   itemconfiguresplitr  	enumerater  r  r   rW   r!   r  dictitemsassertInr   rY  )	r'   r(   colorsr   colorprefixdkr   s	            r   test_itemconfigurezListboxTest.test_itemconfigure  s   ##H.LM  # N<BBDe%f%!&)HAu  u 5 *y)  " *##H.GH  ' ITYY':5/FCF--a>)6)5)	+--e\B,6,8,	.--flC)6)5)	+   #a&GGIDAqMM#a&&)1v{  F$8$8A$>?  1vq!'<=	 / NM *)HHs#   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)Nrw  r/  r   r0  r  r   r   zunknown color name "spam"r  )r   )r    r  r  r!   rY  r,  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 F  5tVn5 KJJs   B55B>c                 (    | j                  dd       y )NrC   #ff0000r  r-  s    r   test_itemconfigure_backgroundz)ListboxTest.test_itemconfigure_background        y9r   c                 (    | j                  dd       y )Nbgr  r  r-  s    r   test_itemconfigure_bgz!ListboxTest.test_itemconfigure_bg        y1r   c                 (    | j                  dd       y )Nfg#110022r  r-  s    r   test_itemconfigure_fgz!ListboxTest.test_itemconfigure_fg  r  r   c                 (    | j                  dd       y )Nr|   r  r  r-  s    r   test_itemconfigure_foregroundz)ListboxTest.test_itemconfigure_foreground  r  r   c                 (    | j                  dd       y )Nr>  r  r  r-  s    r   #test_itemconfigure_selectbackgroundz/ListboxTest.test_itemconfigure_selectbackground        !3Y?r   c                 (    | j                  dd       y )Nr@  z#654321r  r-  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>       48avz8   r   r  r  r  r4   )
r    r  r   r   r  r  r4  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   rO  )r   ry  r   rO  )r    r  r   r  rU   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>4  r+  r,  r   el0ry  el3rw  el7r-   r  r}  )r9  el4el5)r<  el6r:  r@   )r8  r  r4   r   rA  )r    r  r   r!   r   r  r   r  r-  s     r   test_getzListboxTest.test_get2  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>   rr   r    r  r   r   test_configure_justifyr  r  rh  r  r  r  r  r   r"  r$  r'  r/  r5  r>  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   rC   bigincrementrE   r   rF   digitsr{   r|   r  rH   rI   rJ   r   lengthorientrN   r   r   
resolution	showvaluesliderlengthsliderreliefr   rP   tickintervalr  troughcolorr   rS   verticalc                 B    t        j                  | j                  fi |S r   )rU   ScalerW   rX   s     r   r    zScaleTest.createS  rw   r   c                 N    | j                         }| j                  |dddd       y )NrB  g(@g7@r  r  r   s     r   test_configure_bigincrementz%ScaleTest.test_configure_bigincrementV  s#    V^T4Dr   c                 L    | j                         }| j                  |ddd       y )NrC  r}  r   r   r   s     r   test_configure_digitszScaleTest.test_configure_digitsZ  s!    vxA6r   c                     | j                         }t        | j                        dk\  rt        nt        }| j                  |dddd|       y )N)r   rO  r  r  r  -@333333.@r  )r    r   rW   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-   rd  r   s     r   test_configure_labelzScaleTest.test_configure_labelc  s-    6,r   c                 P    | j                         }| j                  |ddddd       y )NrD     gffffff`@g33333`@5ir	  r   s     r   test_configure_lengthzScaleTest.test_configure_lengthh  s%    fhUE4Hr   c                 P    | j                         }| j                  |ddddd       y )NrF  g@r   g@rP  r  r   s     r   test_configure_resolutionz#ScaleTest.test_configure_resolutionl  s%    V\33Cr   c                 H    | j                         }| j                  |d       y )NrG  r  r   s     r   test_configure_showvaluez"ScaleTest.test_configure_showvaluep  s    v{3r   c           	      R    | j                         }| j                  |dddddd       y )NrH  r  rR  333333/@rB  3mr	  r   s     r   test_configure_sliderlengthz%ScaleTest.test_configure_sliderlengtht  s*    fn $b$	8r   c                 H    | j                         }| j                  |d       y )NrI  r  r   s     r   test_configure_sliderreliefz%ScaleTest.test_configure_sliderreliefy  r  r   c           	          | j                         }| j                  |dddddt               | j                  |dddt        	       y )
NrJ  r4   333333@r  r   r  rP  r   )r   r  )r    r  r   r^   r   s     r   test_configure_tickintervalz%ScaleTest.test_configure_tickinterval}  sK    V^QS!"- 	 	/Q( 	 	*r   c           	      \    | j                         }| j                  |dddddt               y )Nr  i,  rT  rU  r  r  )r    r  r   r   s     r   r  zScaleTest.test_configure_to  s/    VT3dC"- 	 	/r   N)r#   r=   r>   rr   default_orientr    rP  rR  r  rW  r[  r]  r_  rc  re  rh  r  r@   r   r   rA  rA  F  sP    G  N2E7I
-
ID48
6*/r   rA  c                   :    e Zd ZdZeZdZdZd Zd Z	d Z
d Zd Zy	)
ScrollbarTest)r   activereliefrC   rE   r   rF   elementborderwidthrH   rI   rJ   jumprE  rN   r   r   rP   rK  rS   TrL  c                 B    t        j                  | j                  fi |S r   )rU   	ScrollbarrW   rX   s     r   r    zScrollbarTest.create  s      5f55r   c                     | j                         }| j                  |dddd       t        dk\  r| j                  nd}| j	                  |dd|       y )Nrn  rg  ffffff@1mr   rP  r   )r    rU  r   _default_pixelsr^   r'   r(   r   s      r   !test_configure_elementborderwidthz/ScrollbarTest.test_configure_elementborderwidth  sM    f&:CdK+5+?4''R 4b8Lr   c                 R    | j                         }| j                  |ddddd       y )NrE  rL  
horizontalorientationT)fullnameallow_emptyr   r   s     r   test_configure_orientz#ScrollbarTest.test_configure_orient  s.    FHj,%2 	 	F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-   r  r  )r    activater!   r4  r  r  )r'   sbr   s      r   test_activatezScrollbarTest.test_activate  sq    [[]/AKKNR[[]A. 0 	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'   r  s     r   test_setzScrollbarTest.test_set  s    [[]
sC:.(BFFE59(BFFC7(BFFC6)RVVS1)RVVS#s;r   N)r#   r=   r>   rr   r   r   r  rj  r    rw  r}  r  r  r@   r   r   rl  rl    s6    G LJN6MF
F<r   rl  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)rC   rE   rF   	handlepad
handlesizerG   opaqueresizerE  proxybackgroundproxyborderwidthproxyreliefrN   
sashcursorsashpad
sashrelief	sashwidth
showhandlerS   ry  c                 B    t        j                  | j                  fi |S r   )rU   PanedWindowrW   rX   s     r   r    zPanedWindowTest.create  r   r   c           	      R    | j                         }| j                  |dddddd       y )Nr  r}  r  r  rB  rt  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%@rB  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 )
NrG   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   rO  r}  c                 H    | j                         }| j                  |d       y )Nr  rH  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   rM  g333333@rO  rP  rQ  Fr  r	  r   s     r   test_configure_proxyborderwidthz/PanedWindowTest.test_configure_proxyborderwidth  s5    f&8c1b%#( 	 	*r   c                 Z    | j                         }| j                  |dt        dk\         y )Nr  r   )r|  )r    r  r   r   s     r   test_configure_proxyreliefz*PanedWindowTest.test_configure_proxyrelief  s-    fm+5+? 	 	Br   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   rM  rN  rP  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&@ra  rB  rt  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 )
NrS   r#  fffff6y@皙Iy@r$  r   rZ  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    rU   r   addr'   pr   r0  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   r0  r  r  r   s          r   test_paneconfigurez"PanedWindowTest.test_paneconfigure  s    ,,.1a)Q__5OOAa&GGIDAqSVQ'Q1 56QqT1::a#34 r   c                     | j                   st        |      } |j                  |fi ||i | j                  |j                  ||      d   |       | j                  |j	                  ||      |       y )Nr   )r7   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)r,  r   r  )r'   r  r   r   msgs        r   check_paneconfigure_badz'PanedWindowTest.check_paneconfigure_bad"  s6    ##Hc2AOOA4$
!34 322s   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t        j	                  d             y )NrG   r  r  r  r  r  (EXPECTED_SCREEN_DISTANCE_OR_EMPTY_ERRMSGr  r  s       r   test_paneconfigure_heightz)PanedWindowTest.test_paneconfigure_height2  sL    ,,.1a  AxR8$$Q88??
K	Mr   c                 ~    | j                         \  }}}| j                  ||ddd       | j                  ||dd       y )NhideFr   z)expected boolean value but got "badValue"r  r  r  r  s       r   test_paneconfigure_hidez'PanedWindowTest.test_paneconfigure_hide8  sA    ,,.1a  Avua8$$Q6%P	Rr   c                     | j                         \  }}}| j                  ||ddd       | j                  ||dt        j	                  d             y )Nminsizer  r  r  r  r  r'  r  r  s       r   test_paneconfigure_minsizez*PanedWindowTest.test_paneconfigure_minsize>  sL    ,,.1a  Ay"b9$$Q9/66zB	Dr   c                     | j                         \  }}}| j                  ||ddd       | j                  ||dt        j	                  d             y )NrL   rM  r4   r  r  r  s       r   test_paneconfigure_padxz'PanedWindowTest.test_paneconfigure_padxD  L    ,,.1a  AvsA6$$Q6/66zB	Dr   c                     | j                         \  }}}| j                  ||ddd       | j                  ||dt        j	                  d             y )NrM   rM  r4   r  r  r  s       r   test_paneconfigure_padyz'PanedWindowTest.test_paneconfigure_padyJ  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_stickyP  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_stretchX  sD    ,,.1a  Ay%B$$Q9&M	Nr   c                     | j                         \  }}}| j                  ||ddd       | j                  ||dt        j	                  d             y )NrS   r  r  r  r  s       r   test_paneconfigure_widthz(PanedWindowTest.test_paneconfigure_width_  sL    ,,.1a  AwB7$$Q78??
K	Mr   N)"r#   r=   r>   rr   rj  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B B
4H4*
5*
585HHMRDDD7NMr   r  c                       e Zd ZdZdZd Zd Z  edd      ej                        Z	d Z
d Zd	 Zd
 Zd Zd Zd Zd Zy)MenuTest)r   activeborderwidthr   rm  rC   rE   rF   r   r{   r|   postcommandrN   r   rP   tearofftearoffcommandr$   typeFc                 B    t        j                  | j                  fi |S r   )rU   r]   rW   rX   s     r   r    zMenuTest.creater  r  r   c                 h    | j                         }|j                  d      }| j                  |       y )Nro  )r    indexr4  )r'   r(   r   s      r   test_indexcommand_nonezMenuTest.test_indexcommand_noneu  s)    LL !r   r   r   c                 H    | j                         }| j                  |d       y )Nr  r\  r   s     r   test_configure_postcommandz#MenuTest.test_configure_postcommand|  r  r   c                 H    | j                         }| j                  |d       y )Nr  r  r   s     r   test_configure_tearoffzMenuTest.test_configure_tearoff  rF  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   rd  r   s     r   test_configure_titlezMenuTest.test_configure_title  s    6r   c                 t    | j                         }d} | j                  |dg|t        dk  t        dk\  d y )N)r   r  menubarr  r   )r|  sort)r    r   r   )r'   r(   r*  s      r   test_configure_typezMenuTest.test_configure_type  sB    1FF 	7V 	7(2V(;!+v!5	7r   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   r4   r}  r   r   )r    add_commandr  r  entryconfigurer,  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$ La a&GGIDAq!!!S)!!!U+SVQ'QqT1%R\\!Q/16  	

 LKs   EEc                     | j                         }|j                  d       | j                  |j                  dd      d       |j	                  dd       | j                  |j                  dd      d       y )Nr   r  r4   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   r4   r   )r   )	r    rU   
BooleanVarrW   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>   rr   r   r    r  r   r   test_configure_activereliefr  r  r  r  r   r  r  r  r@   r   r   r  r  f  s`    G L1
 #4+a"34H4d4d"e62977 >Dr   r  c                   T    e Zd ZdZdZedk\  rdZedk\  Zedk\  Zd Z	d Z
d Zd Zd Zy	)
MessageTest)r   aspectrC   rE   rF   r{   r|   rH   rI   rJ   r   rL   rM   rN   rP   r   r   rS   Fr   c                 B    t        j                  | j                  fi |S r   )rU   MessagerW   rX   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   c           	          | j                         }| j                  |ddddd| j                         | j                  r| j                  nd}| j                  |dd|       y )	NrL   ry  皙@rs  12mr  rP  r   r    rU  r?   r   ru  r^   rv  s      r   test_configure_padxzMessageTest.test_configure_padx  \    ffac5#'#8#8 	 	:+/>>4''rX>r   c           	          | j                         }| j                  |ddddd| j                         | j                  r| j                  nd}| j                  |dd|       y )	NrM   ry  r  rs  r  r  rP  r   r  rv  s      r   test_configure_padyzMessageTest.test_configure_pady  r!  r   c           	          | j                         }| j                  |dddddd       t        dk\  rdnd}| j                  |dd|	       y )
NrS   r#  r  r  r   rZ  r   r$  r   )r    rU  r   r^   rv  s      r   r%  z MessageTest.test_configure_width  sI    fgsE5!TJ"f,1$Ar   N)r#   r=   r>   rr   r?   r   r   r   r   r    r  r   r#  r%  r@   r   r   r  r    sM    G Vf$I"f,4???Br   r  c                       e Zd Zd Zd Zy)DefaultRootTestc                 B    | j                  t        j                         y r   )_test_widgetrU   rv   r-  s    r   
test_framezDefaultRootTest.test_frame      '--(r   c                 B    | j                  t        j                         y r   )r(  rU   r   r-  s    r   
test_labelzDefaultRootTest.test_label  r*  r   N)r#   r=   r>   r)  r,  r@   r   r   r&  r&    s    ))r   r&  __main__)/unittestrU   r   rf   test.supportr   test.test_tkinter.supportr   r   r   r   r	   test.test_tkinter.widget_testsr
   r   r   r   r   r'  r  r   r   TestCaserB   rt   rz   r   r   r   r   r   r  r'  r2  r  r  r6  r  rA  rl  r  r  r  r&  	tests_guir#   mainr@   r   r   <module>r5     s      	 !; ;P P 	 #S +a ("7-~ "7J *+'2'):): '2 ,'2T *+	2$h&7&7 	2 ,	2 *+)8+<+<  ,6-*,< - *+2!8#4#4 2 ,2 *+O"H$5$5 O ,O( *+3%'):): 3% ,3%l *+D'):): D ,D, *+3H&(9(9 3H ,3Hl?^X%6%6 ? &(<=Y#"H$5$5 Y# >Y#x *+EC)X.. EC ,ECP *+E@!8#4#4 E@ ,E@P n&:;}3#X%6%6 }3 <}3@ &(<=F1$h&7&7 F1 >F1R n&:;@/"H$5$5 @/ <@/F n&:;-<&(9(9 -< <-<` *+gM((*;*; gM ,gMT *+KD!8#4#4 KD ,KD\ n&:;'B$h&7&7 'B <'BT)-x/@/@ ) 	J>)[+~)]X|_	 zHMMO r   