
    daf                        d dl Z d dlZd dlZd dlmZ d dlmZ d dlmZ d dlm	Z	  ed        G d de	e j                        Z G d	 d
e	e j                        Z G d de	e j                        ZeeefZedk(  r e j                           yy)    N)TclError)requires)pixels_conv)AbstractWidgetTestguic                   ^    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)PackTestNc                 h   t        j                  | j                  d      }|j                  d       |j	                  dd       t        j
                  |dddd	      }t        j
                  |d
ddd	      }t        j
                  |dddd	      }t        j
                  |dddd	      }|||||fS )Npack)name300x200+0+0   a   (   red)r   widthheightbgb2      bluecP   greendyellow)tkinterToplevelrootwm_geometry
wm_minsizeFrameselfr   r   r   r   r   s         C/root/Python-3.12.4/Lib/test/test_tkinter/test_geometry_managers.pycreate2zPackTest.create2   s    		7'1MM$S2%HMM$S2&IMM$S2'JMM$S2(KQ1a    c                    | j                         \  }}}}}| j                  t        d|z        5  |j                  |       d d d        | j                  t        d      5  |j                  d       d d d        |j                  d       |j                  d       |j                  d       |j                  d       | j	                  |j                         ||||g       |j                  |       | j	                  |j                         ||||g       |j                  |       | j	                  |j                         ||||g       y # 1 sw Y   xY w# 1 sw Y   xY w)Nwindow "%s" isn't packed)afterbad window path name ".foo".footopsider(   assertRaisesRegexr   pack_configureassertEqualpack_slavesr%   s         r'   test_pack_configure_afterz"PackTest.test_pack_configure_after   sT   <<>aAq##H.IA.MN 	&1%	&##H.KL 	+6*	+	e$	e$	e$	e$))+aAq\:	q!))+aAq\:	q!))+aAq\:	& 	&	+ 	+   E!E"E"E+c                       j                         \  }}}} fd} |dd        |dd        |dd        |dd	        |d
d        |dd        |dd        |dd        |dd       y )Nc           	          j                  dddddd|        j                  j                          j                  j	                         |       y )Nr/      
      r   T)r1   ipadxpadxipadypadyexpandanchor)r4   r!   updater5   winfo_geometry)rC   geomr   r&   s     r'   checkz2PackTest.test_pack_configure_anchor.<locals>.check-   sN    %qr"$(  9IIQ--/6r)   nz30x70+135+20nez30x70+260+20ez30x70+260+65sez30x70+260+110sz30x70+135+110swz30x70+10+110wz30x70+10+65nwz30x70+10+20centerz30x70+135+65r(   )r&   r   r   r   r   rG   r   s   `     @r'   test_pack_configure_anchorz#PackTest.test_pack_configure_anchor+   sz    <<>aAq	7
 	c>"dN#c>"dO$c?#dN#c=!dM"h'r)   c                    | j                         \  }}}}}| j                  t        d|z        5  |j                  |       d d d        | j                  t        d      5  |j                  d       d d d        |j                  d       |j                  d       |j                  d       |j                  d       | j	                  |j                         ||||g       |j                  |       | j	                  |j                         ||||g       |j                  |       | j	                  |j                         ||||g       y # 1 sw Y   xY w# 1 sw Y   xY w)Nr+   )beforer-   r.   r/   r0   r2   r%   s         r'   test_pack_configure_beforez#PackTest.test_pack_configure_before<   sT   <<>aAq##H.IA.MN 	'A&	'##H.KL 	,F+	,	e$	e$	e$	e$))+aAq\:	"))+aAq\:	"))+aAq\:	' 	'	, 	,r8   c                 V     j                         \  } fd}j                  d       j                  d       j                  d       j                  d        |ddd	d
       j                  dd       j                  dd       j                  dd       j                  dd        |dddd       j                  ddd       j                  ddd       j                  ddd       j                  ddd        |dddd       y )Nc                  R   j                   j                          j                  j                         | d          j                  j                         | d          j                  j                         | d          j                  j                         | d          y )Nr   r         )r!   rD   r5   rE   )geomsr   r   r   r   r&   s    r'   rG   z2PackTest.test_pack_configure_expand.<locals>.checkN   s    IIQ--/q:Q--/q:Q--/q:Q--/q:r)   leftr0   r/   rightbottom
20x40+0+80z50x30+135+0z80x80+220+75z40x30+100+170yes)r1   rB   onTr   z20x40+40+80z50x30+175+35z80x80+180+110z40x30+100+135both)r1   rB   fillz100x200+0+0z200x100+100+0z160x100+140+100z40x100+100+100)r(   r4   )r&   r   rG   r   r   r   r   s   `  @@@@r'   test_pack_configure_expandz#PackTest.test_pack_configure_expandL   s5   <<>aAq	; 	; 	
f%	e$	g&	h'lM>?K	fU3	eD1	gd3	hq1m^_oN	fU@	eDv>	gd@	hqv>m_.?AQRr)   c                    | j                         \  }}}}}|j                  d       |j                  d       |j                  d       |j                  d       |j                  |       | j                  |j                         ||||g       |j                  |       | j                  |j                         |||g       | j                  |j                         |g       | j	                  t
        d|d      5  |j                  |       d d d        | j	                  t
        d      5  |j                  d       d d d        y # 1 sw Y   ;xY w# 1 sw Y   y xY w)Nr/   r0   in_zcan't pack "?z"? inside itselfr-   r.   )r(   r4   r5   r6   r3   r   r%   s         r'   test_pack_configure_inzPackTest.test_pack_configure_ind   sQ   <<>aAq	e$	e$	e$	e$	T"))+aAq\:	Q))+aAY71#.##1FH 	$#	$ ##H.KL 	)(	) 	)	$ 	$	) 	)s   E6EEE'c                 z     j                         \  }}} fd} |dddd        |dddd        |d	ddd
        |ddddd        |ddddd        |ddddd        |d	dddd        |dddddd        |dddddd        |dddd        |dddd        |dddd
        |ddddd        |ddddd        |d dddd        |d!ddd"d        |d#dddd        |d$ddddd        |d%ddddd       j                  d&'        j                  j                         d(    j	                  |j                  d&                   j                  d&)        j                  j                         d*    j	                  |j                  d&                   y )+Nc                 D   j                          j                           j                  di | j                  dd       j                  j                          j	                  j                         |        j	                  j                         |       y NTra   rB   rb    pack_forgetr4   r!   rD   r5   rE   geom1geom2kwargsr   r   r&   s      r'   rG   z;PackTest.test_pack_configure_padx_ipadx_fill.<locals>.checkw   }    MMOMMOA&v&Dv6IIQ--/7Q--/7r)   z20x40+260+80z240x200+0+0r\   r   )r1   r?   z20x40+250+80r<   r   z60x40+240+80)r1   r>   z30x40+260+80z250x200+0+0r;   r<   )r1   r>   r?   x)r1   r?   rb   z20x40+249+80	      )r1   r>   rb   )r1   r>   r?   rb   z30x40+255+80r;   r=   20x40+140+0300x160+0+40r/   z20x40+120+0r   r   z60x40+120+0z30x40+135+0z30x40+130+0z260x40+20+0z260x40+25+0   r=   z
300x40+0+0z280x40+10+0z
280x40+5+01cr?   r?   r>   r>   r(   r4   r5   	pack_info_strwinfo_pixelsr&   r   r   r   rG   r   r   s   `    @@r'   #test_pack_configure_padx_ipadx_fillz,PackTest.test_pack_configure_padx_ipadx_fillu   s   <<>aAq	8 	nm'Cnm'Inm'Dnm'Lnm'Mnms	4nm'#Nnm!"3	8nm!'	=m^%bAm^%gFm^%rBm^%qrJm^%qwOm^%bsKm^xc	3lNbsKm^	6lNc	;	d#v.4#4#4T#:;	=	t$w/4#4#4T#:;	=r)   c                 z     j                         \  }}} fd} |dddd        |dddd        |d	ddd
        |ddddd        |ddddd        |ddddd        |d	dddd        |dddddd        |dddddd        |dddd        |dddd        |dddd
        |ddddd        |ddddd        |d dddd        |d!ddd"d        |d#dddd        |d$ddddd        |d%ddddd       j                  d&'        j                  j                         d(    j	                  |j                  d&                   j                  d&)        j                  j                         d*    j	                  |j                  d&                   y )+Nc                 D   j                          j                           j                  di | j                  dd       j                  j                          j	                  j                         |        j	                  j                         |       y rj   rm   ro   s      r'   rG   z;PackTest.test_pack_configure_pady_ipady_fill.<locals>.check   rs   r)   20x40+280+80280x200+0+0r\   r   )r1   rA   z20x40+280+70rt   z20x80+280+60)r1   r@   z20x50+280+75r;   r<   )r1   r@   rA   ru   )r1   rA   rb   z20x40+280+69rv   )r1   r@   rb   )r1   r@   rA   rb   z20x50+280+70ry   z20x40+140+20z300x120+0+80r/   rz   r|   z20x80+140+0z20x50+140+10z300x130+0+70z20x50+140+5z300x40+0+20z300x40+0+25r}   z
300x80+0+0z300x50+0+10z
300x50+0+5r   rA   rA   r@   r@   r   r   s   `    @@r'   #test_pack_configure_pady_ipady_fillz,PackTest.test_pack_configure_pady_ipady_fill   s   <<>aAq	8 	nm'Cnm'Inm'Dnm'Lnm'Mnms	4nm'#Nnm!"3	8nm!'	=nn5rBm^%gFm^%rBnn5Km^%qwOm^%bsKm^xc	3lNbsKm^	6lNc	;	d#v.4#4#4T#:;	=	t$w/4#4#4T#:;	=r)   c                       j                         \  }}} fd} |ddd        |ddd        |dd	d
        |ddd       y )Nc                 J   j                  |        j                  j                         d   |        j                  dd       j                  j	                          j                  j                         |       j                  j                         |       y )Nr0   r1   Tra   rk   )r4   r5   r   r!   rD   rE   )r1   rp   rq   r   r   r&   s      r'   rG   z0PackTest.test_pack_configure_side.<locals>.check   s    $'Q[[]62D9Dv6IIQ--/7Q--/7r)   r/   rz   r{   r]   z20x40+140+160z300x160+0+0r[   r^   z280x200+20+0r\   r   r   rQ   r   s   `    @@r'   test_pack_configure_sidez!PackTest.test_pack_configure_side   sP    <<>aAq	8 	e]N3h7flN3g~}5r)   c                    | j                         \  }}}}}|j                          |j                          |j                          | j                  |j                         |||g       |j	                          | j                  |j                         ||g       |j	                          | j                  |j                         ||g       |j	                          y N)r(   r4   r5   r6   rn   r%   s         r'   test_pack_forgetzPackTest.test_pack_forget   s    <<>aAq			))+aAY7	))+aV4	))+aV4	r)   c                    | j                         \  }}}}}| j                  t        d|z        5  |j                          d d d        |j	                          |j	                  d|ddddddd	
	       |j                         }| j                  |t               | j                  |d   d       | j                  |d   | j                  d             | j                  |d   d       | j                  |d   |       | j                  |d   | j                  d             | j                  |d   | j                  d             | j                  |d   | j                  d             | j                  |d   | j                  d             | j                  |d   d       |j                         }| j                  |t               | j                  |d   d       | j                  |d   | j                  d             | j                  |d   d       | j                  |d   |       | j                  |d   | j                  d             | j                  |d   | j                  d             | j                  |d   | j                  d             | j                  |d   | j                  d	             | j                  |d   d       y # 1 sw Y   xY w)Nr+   r\   rL   Tru   r;   r<   rX   ry   )	r1   rf   rC   rB   rb   r>   r?   r@   rA   rC   rP   rB   r   rb   noneinr>   r@   r?   rA   r1   r/   r   )	r(   r3   r   r   r4   assertIsInstancedictr5   r   )r&   r   r   r   r   r   infos          r'   test_pack_infozPackTest.test_pack_info   sn   <<>aAq##H.IA.MN 	KKM			g1SC r 	 	B{{}dD)h2h16fv.dT*g		!5g		!5ftyy|4ftyy|4fu-{{}dD)h-h16fs+dQ'g		!5g		!5ftyy}5ftyy'9:fw/5	 	s   KKc                 "   | j                         \  }}}}}|j                  dd       |j                          |j                  d       | j                  j                          | j                  |j                         d       | j                  |j                         d       |j                  d       | j                  j                          | j                  |j                         d       | j                  |j                         d       y )N,     r   r   FTr   r   )	r(   	configurer4   pack_propagater!   rD   r5   winfo_reqwidthwinfo_reqheightr%   s         r'   test_pack_propagatezPackTest.test_pack_propagate  s    <<>aAqS-	E"		,,.4--/5D!		,,.3--/4r)   c                 6   | j                         \  }}}}}| j                  |j                         g        |j                          | j                  |j                         |g       |j                          | j                  |j                         ||g       y r   )r(   r5   r6   r4   r%   s         r'   test_pack_slaveszPackTest.test_pack_slaves  s    <<>aAq))+R0	))+aS1	))+aV4r)   )__name__
__module____qualname__	test_keysr(   r7   rR   rU   rc   rg   r   r   r   r   r   r   r   rl   r)   r'   r	   r	      sK    I ; ("; S0)"(=T(=T6
0<55r)   r	   c                   j    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)	PlaceTestNc                 6   t        j                  | j                  ddd      }|j                  d       t        j                  |dddd	
      }|j                  dd       t        j                  |dddd	
      }| j                  j                          |||fS )Nr   r   r   )r   r   bdr      T   rX   raised)r   r   r   relief0   &   )ru   yr   <   )r   r    r!   r"   r$   place_configurerD   r&   tff2s       r'   r(   zPlaceTest.create2  s    TYYc#!D	m$MM!3raI	B"%]]1BraI		!Rxr)   c           	      B   | j                         \  }}}| j                  |j                         d       | j                  t        dt        j                  t        |            z        5  |j                  |       d d d        | j                  |j                         d       | j                  t        d      5  |j                  d       d d d        |j                  |       | j                  |j                         d       y # 1 sw Y   xY w# 1 sw Y   HxY w)N z%can't place "?%s"? relative to itselfre   zbad window path namespamplace)	r(   r5   winfo_managerr3   r   reescapestrr   r   s       r'   test_place_configure_inz!PlaceTest.test_place_configure_in$  s    <<>1b))+R0##;99SW%&' 	' 2&		'
 	))+R0##H.DE 	+6*	+
q!))+W5	' 	'	+ 	+s   *D	;D	DDc                 D   | j                         \  }}}|j                  |       | j                  |j                         d   d       | j                  j                          | j                  |j                         d       |j                  d       | j                  |j                         d   d       | j                  j                          | j                  |j                         d       |j                  d	d
       | j                  |j                         d   d       | j                  j                          | j                  |j                         d       | j                  t        d      5  |j                  |d       d d d        y # 1 sw Y   y xY w)Nre   ru   0r   d   )ru   100   r   )ru   relx-10   bad screen distance "spam"r   )rf   ru   	r(   r   r5   
place_infor!   rD   winfo_xr3   r   r   s       r'   test_place_configure_xz PlaceTest.test_place_configure_x2  sD   <<>1b
q!-s3		r*
S!-u5		s+
Sq)-u5		s+##H.JK 	01/	0 	0 	0   9FFc                 D   | j                         \  }}}|j                  |       | j                  |j                         d   d       | j                  j                          | j                  |j                         d       |j                  d       | j                  |j                         d   d       | j                  j                          | j                  |j                         d       |j                  d	d
       | j                  |j                         d   d       | j                  j                          | j                  |j                         d       | j                  t        d      5  |j                  |d       d d d        y # 1 sw Y   y xY w)Nre   r   r   r   r   )r   50Z   r   r   )r   relyr   n   r   r   )rf   r   	r(   r   r5   r   r!   rD   winfo_yr3   r   r   s       r'   test_place_configure_yz PlaceTest.test_place_configure_yC  sD   <<>1b
q!-s3		r*
R -t4		r*
Sq)-u5		s+##H.JK 	01/	0 	0 	0r   c                 B   | j                         \  }}}|j                  |       | j                  |j                         d   d       | j                  j                          | j                  |j                         d       |j                  d       | j                  |j                         d   d       | j                  j                          | j                  |j                         d       |j                  d	       | j                  |j                         d   d
       | j                  j                          | j                  |j                         d       | j                  t        d      5  |j                  |d       d d d        y # 1 sw Y   y xY w)Nre   r   r   r         ?)r   0.5}   r   1r   -expected floating-point number but got "spam"r   )rf   r   r   r   s       r'   test_place_configure_relxz#PlaceTest.test_place_configure_relxT  sF   <<>1b
q!0#6		r*
$0%8		s+
"0#6		s+##H /5 6 	3162	3 	3 	3   8FFc                 B   | j                         \  }}}|j                  |       | j                  |j                         d   d       | j                  j                          | j                  |j                         d       |j                  d       | j                  |j                         d   d       | j                  j                          | j                  |j                         d       |j                  d	       | j                  |j                         d   d
       | j                  j                          | j                  |j                         d       | j                  t        d      5  |j                  |d       d d d        y # 1 sw Y   y xY w)Nre   r   r   r   r   )r   r   r   r   r   x   r   r   )rf   r   r   r   s       r'   test_place_configure_relyz#PlaceTest.test_place_configure_relyf  sF   <<>1b
q!0#6		r*
$0%8		r*
"0#6		s+##H /5 6 	3162	3 	3 	3r   c                    t        j                  | j                        }| j                  t        d      5  |j                  d       d d d        | j                  t        d      5  |j                  d       d d d        dD ]7  }|j                  |       | j                  |j                         d   |       9 y # 1 sw Y   wxY w# 1 sw Y   RxY w)Nzbad anchor "j"j)rC   ambiguous anchor ""r   )	rH   rI   rJ   rK   rL   rM   rN   rO   rP   rC   r   r$   r!   r3   r   r   r5   r   r&   r   values      r'   test_place_configure_anchorz%PlaceTest.test_place_configure_anchorx  s    MM$))$##H.>? 	*S)	*##H.CD 	)R(	)I 	>EU+Q\\^H5u=	>		* 	*	) 	)   B?'C?CCc                    | j                         \  }}}|j                  |d       | j                  j                          | j	                  |j                         d       |j                  d       | j                  j                          | j	                  |j                         d       | j                  t        d      5  |j                  d       d d d        y # 1 sw Y   y xY w)Nr   )rf   r   r   )r   r   bad screen distance "abcd"abcdr(   r   r!   rD   r5   winfo_widthr3   r   r   s       r'   test_place_configure_widthz$PlaceTest.test_place_configure_width  s    <<>1b
q,		)3/
$		)2.##H.JK 	-V,	- 	- 	-   C  C)c                    | j                         \  }}}|j                  |d       | j                  j                          | j	                  |j                         d       |j                  d       | j                  j                          | j	                  |j                         d       | j                  t        d      5  |j                  d       d d d        y # 1 sw Y   y xY w)Nr   )rf   r   r   )r   r   r   r   r(   r   r!   rD   r5   winfo_heightr3   r   r   s       r'   test_place_configure_heightz%PlaceTest.test_place_configure_height  s    <<>1b
q-		*C0
"%		*B/##H.JK 	.f-	. 	. 	.r   c                    | j                         \  }}}|j                  |d       | j                  j                          | j	                  |j                         d       |j                  d       | j                  j                          | j	                  |j                         d       | j                  t        d      5  |j                  d       d d d        y # 1 sw Y   y xY w)	Nr   )rf   relwidthK   r   )r   r   -expected floating-point number but got "abcd"r   r   r   s       r'   test_place_configure_relwidthz'PlaceTest.test_place_configure_relwidth  s    <<>1b
q3/		)2.
B'		)2.##H /5 6 	0/	0 	0 	0r   c                    | j                         \  }}}|j                  |d       | j                  j                          | j	                  |j                         d       |j                  d       | j                  j                          | j	                  |j                         d       | j                  t        d      5  |j                  d       d d d        y # 1 sw Y   y xY w)	Nr   )rf   	relheightr   r   )r   r   r   r   r   r   s       r'   test_place_configure_relheightz(PlaceTest.test_place_configure_relheight  s    <<>1b
qC0		*B/
R(		*B/##H /5 6 	10	1 	1 	1r   c                    t        j                  | j                        }| j                  t        d      5  |j                  d       d d d        | j                  t        d      5  |j                  d       d d d        dD ]7  }|j                  |       | j                  |j                         d   |       9 y # 1 sw Y   wxY w# 1 sw Y   RxY w)Nzbad bordermode "j"r   )
bordermodezambiguous bordermode ""r   )insideoutsideignorer  r   r   s      r'   test_place_configure_bordermodez)PlaceTest.test_place_configure_bordermode  s    MM$))$##H.BC 	.-	.##H.GH 	-,	-2 	BE/Q\\^L95A	B		. 	.	- 	-r   c                    t        j                  | j                        }|j                  dd       | j                  j	                          |j                          | j                  j	                          | j                  |j                                | j                  t              5  |j                  d       d d d        y # 1 sw Y   y xY w)Nr   r   r   )
r   r$   r!   r   rD   place_forgetassertFalsewinfo_ismappedassertRaises	TypeError)r&   foos     r'   test_place_forgetzPlaceTest.test_place_forget  s    mmDII&"R0				++-.y) 	 Q	  	  	 s   +CCc                    | j                         \  }}}|j                  |ddddddddd	d
       |j                         }| j                  |t               | 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       | j                  t              5  |j                  d       d d d        y # 1 sw Y   y xY w)Nr   rX   rY      g?g?g333333?g?rK   r  )rf   ru   r   r   r   r   r   r   r   rC   r  ru   r   r   2r   3r   4r   z0.1r   z0.2r   z0.3r   z0.4rC   r  r   )r(   r   r   r   r   r5   r  r  )r&   r   r   r   r   s        r'   test_place_infozPlaceTest.test_place_info  s}   <<>1b
qA!A ##s"&9 	 	> }}dD)cC(cC(g,h-fu-fu-j)51k*E2h.l+Y7cC(cC(y) 	MM!	 	 	s   (FFc                    t        j                  | j                        }t        j                  | j                        }| j                  |j	                         g        |j                  |       | j                  |j	                         |g       | j                  t              5  |j	                  d       d d d        y # 1 sw Y   y xY w)Nre   r   )r   r$   r!   r5   place_slavesr   r  r  )r&   r  bars      r'   test_place_slaveszPlaceTest.test_place_slaves  s    mmDII&mmDII&))+R0$))+cU3y) 	 Q	  	  	 s   'CC)r   r   r   r   r(   r   r   r   r   r   r   r   r   r   r  r  r  r  r  rl   r)   r'   r   r     sS    I60"0"3$3$>	-	.
0
1B , r)   r   c                        e Zd ZdZ fdZd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Z d Z!d  Z" xZ#S )!GridTestNc                    | j                   j                         \  }}t        |dz         D ]"  }| j                   j                  |dddd       $ t        |dz         D ]"  }| j                   j	                  |dddd       $ | j                   j                  d       | j                   j                  d       t        | !          y )Nr   r   r   )weightminsizepaduniformrO   )	r!   	grid_sizerangegrid_columnconfiguregrid_rowconfiguregrid_propagategrid_anchorsupertearDown)r&   colsrowsi	__class__s       r'   r(  zGridTest.tearDown  s    YY((*
dtax 	VAII**1QqRT*U	Vtax 	SAII''!QAr'R	S		  #		d#r)   c                    t        j                  | j                        }| j                  |j	                         i        |j                          | j                  |j	                         d   | j                         | j                  |j	                         d   | j                  d             | j                  |j	                         d   | j                  d             |j                  ddid       | j                  |j	                         d   | j                  d             | j                  |j	                         d   | j                  d             y )Nr   columnr   rowr   rX   r/  )r   Buttonr!   r5   	grid_infogrid_configurer   r&   r   s     r'   test_grid_configurezGridTest.test_grid_configure  s    NN499%+	t,dii8x0$))A,?u-tyy|<	(AA.x0$))A,?u-tyy|<r)   c                 D   t        j                  | j                        }| j                  t        d      5  |j                  d       d d d        |j                  d       | j                  |j                         d   | j                  d             y # 1 sw Y   NxY w)Nz5bad column value "-1": must be a non-negative integerr.  rX   r.  	r   r1  r!   r3   r   r3  r5   r2  r   r4  s     r'   test_grid_configure_columnz#GridTest.test_grid_configure_column  s    NN499%##H /E F 	(B'	( 	
"x0$))A,?		( 	(   BBc                 D   t        j                  | j                        }| j                  t        d      5  |j                  d       d d d        |j                  d       | j                  |j                         d   | j                  d             y # 1 sw Y   NxY w)Nz4bad columnspan value "0": must be a positive integerr   )
columnspanrX   r=  r9  r4  s     r'   test_grid_configure_columnspanz'GridTest.test_grid_configure_columnspan  s    NN499%##H /A B 	+*	+ 	
A&|4diilC		+ 	+r;  c                 8   t        j                  | j                        }t        j                  | j                        }| j	                  |j                         i        |j                          | j	                  |j                         d   | j                         |j                  |       | j	                  |j                         d   |       |j                  d| j                  i       | j	                  |j                         d   | j                         y )Nr   re   )r   r$   r!   r1  r5   r2  r3  )r&   r   r   s      r'   test_grid_configure_inzGridTest.test_grid_configure_in  s    MM$))$NN499%+	t,dii8	Qt,a0	$		*+t,dii8r)   c           
      
   t        j                  | j                        }| j                  t        d      5  |j                  d       d d d        |j                  d       | j                  |j                         d   | j                  d             |j                  d       | j                  |j                         d   | j                  t        t        d      | j                  z                     y # 1 sw Y   xY w)Nz6bad ipadx value "-1": must be positive screen distancer7  r   r   r>   .5cr   r1  r!   r3   r   r3  r5   r2  r   roundr   scalingr4  s     r'   test_grid_configure_ipadxz"GridTest.test_grid_configure_ipadx      NN499%##H /G H 	'2&	' 	
q!w/1>	u%w/5U);dll)J#KL	N	' 	'   C99Dc           
      
   t        j                  | j                        }| j                  t        d      5  |j                  d       d d d        |j                  d       | j                  |j                         d   | j                  d             |j                  d       | j                  |j                         d   | j                  t        t        d      | j                  z                     y # 1 sw Y   xY w)Nz6bad ipady value "-1": must be positive screen distancer7  r   r   r@   rB  rC  r4  s     r'   test_grid_configure_ipadyz"GridTest.test_grid_configure_ipady#  rG  rH  c           
         t        j                  | j                        }| j                  t        d      5  |j                  d       d d d        |j                  d       | j                  |j                         d   | j                  d             |j                  d       | j                  |j                         d   | j                  d             |j                  d       | j                  |j                         d   | j                  t        t        d      | j                  z                     y # 1 sw Y   xY w)N4bad pad value "-1": must be positive screen distancer7  r   r   r?   r<   r;   rB  rC  r4  s     r'   test_grid_configure_padxz!GridTest.test_grid_configure_padx.     NN499%##H /G H 	&"%	& 	
a v.		!=	g&v.		'0BC	e$v.5U);dll)J#KL	N	& 	&   D==Ec           
         t        j                  | j                        }| j                  t        d      5  |j                  d       d d d        |j                  d       | j                  |j                         d   | j                  d             |j                  d       | j                  |j                         d   | j                  d             |j                  d       | j                  |j                         d   | j                  t        t        d      | j                  z                     y # 1 sw Y   xY w)NrL  r7  r   r   rA   rM  rB  rC  r4  s     r'   test_grid_configure_padyz!GridTest.test_grid_configure_pady;  rO  rP  c                 D   t        j                  | j                        }| j                  t        d      5  |j                  d       d d d        |j                  d       | j                  |j                         d   | j                  d             y # 1 sw Y   NxY w)Nz9bad (row|grid) value "-1": must be a non-negative integerr7  r0  rX   r/  r9  r4  s     r'   test_grid_configure_rowz GridTest.test_grid_configure_rowH  s    NN499%##H /E F 	%$	% 	
Qu-tyy|<		% 	%r;  c                 D   t        j                  | j                        }| j                  t        d      5  |j                  d       d d d        |j                  d       | j                  |j                         d   | j                  d             y # 1 sw Y   NxY w)Nz1bad rowspan value "0": must be a positive integerr   )rowspanrX   rV  r9  r4  s     r'   test_grid_configure_rownspanz%GridTest.test_grid_configure_rownspanP  s    NN499%##H /A B 	(Q'	( 	
#y1499Q<@		( 	(r;  c                    t        j                  | j                  d      }| j                  t        d      5  |j                  d       d d d        |j                  d       | j                  |j                         d   d       |j                  d       | j                  |j                         d   d	       y # 1 sw Y   txY w)
Nr   )r   zbad stickyness value "glue"glue)stickyrI   rZ  zn,s,e,wnesw)r   r$   r!   r3   r   r3  r5   r2  r&   r   s     r'   test_grid_configure_stickyz#GridTest.test_grid_configure_stickyX  s    MM$)).##H.KL 	,F+	,	%x0$7		*x0&9	, 	,s   B>>Cc                 
   | j                  t              5  | j                  j                          d d d        | j	                  | j                  j                  d      ddd dd       | j                  t        d      5  | j                  j                  dd       d d d        | j                  j                  dd       | j                  t        d      5  | j                  j                  d       d d d        t        j                  | j                        }|j                  dd	       | j                  j                  d
d       | j                  t        d      5  | j                  j                  d
       d d d        | j	                  | j                  j                  dd      d       | j	                  | j                  j                  dd      d       | j	                  | j                  j                  dd      d       | j                  j                  |d       | j	                  | j                  j                  dd      d       y # 1 sw Y   #xY w# 1 sw Y   xY w# 1 sw Y   {xY w# 1 sw Y   xY wNr   )r  r  r   r  zbad option "-foo"r  )r   rY   rX   r  z*must specify a single element on retrieval)r.  r/  allrY   zexpected integer but got "all"r  i	  r  )
r  r  r!   r#  r5   r3   r   r   r1  r3  r4  s     r'   test_grid_columnconfigurez"GridTest.test_grid_columnconfigurea  s   y) 	-II**,	-77:%&qTQO	Q##H.AB 	5II**1e4	5		&&va&8##H$PR 	3II**62	3 NN499%	q)		&&uQ&7##H.NO 	2II**51	2778DaH778DaH77XFJ		&&q&3778DaH'	- 	-	5 	5	3 	3	2 	2/   I?II, I9II),I69Jc                    | j                  t        d      5  | j                  j                  dd       d d d        | j                  j                  dd       | j	                  | j                  j                  dd      d       | j	                  | j                  j                  d      d   d       y # 1 sw Y   xY wNbad screen distance "foo"r   r  )r  r<   r  r3   r   r!   r#  r5   r&   s    r'   !test_grid_columnconfigure_minsizez*GridTest.test_grid_columnconfigure_minsizew  s    ##H.IJ 	=II**1e*<	=		&&q"&5779ErJ77:9ErJ		= 	=   B55B>c                    | j                  t        d      5  | j                  j                  dd       d d d        | j                  t        d      5  | j                  j                  dd       d d d        | j                  j                  dd       | j	                  | j                  j                  dd      d       | j	                  | j                  j                  d      d   d       y # 1 sw Y   xY w# 1 sw Y   xY w	Nzexpected integer but got "bad"r   badr`  z-invalid arg "-weight": should be non-negativerY   r  rg  rh  s    r'    test_grid_columnconfigure_weightz)GridTest.test_grid_columnconfigure_weight~  s    ##H.NO 	<II**1U*;	<##H /= > 	9II**1R*8	9 			&&q&3778DaH77:8DaH	< 	<	9 	9   C1C=1C:=Dc                    | j                  t        d      5  | j                  j                  dd       d d d        | j                  t        d      5  | j                  j                  dd       d d d        | j                  j                  dd       | j	                  | j                  j                  dd      d       | j	                  | j                  j                  d      d   d       y # 1 sw Y   xY w# 1 sw Y   xY w	Nrf  r   r  )r  z*invalid arg "-pad": should be non-negativern  rY   r  rg  rh  s    r'   test_grid_columnconfigure_padz&GridTest.test_grid_columnconfigure_pad  s    ##H.IJ 	9II**1%*8	9##H /= > 	6II**1"*5	6 			&&qa&0775A1E77:5A1E	9 	9	6 	6rp  c                     | j                   j                  dd       | j                  | j                   j                  dd      d       | j                  | j                   j                  d      d   d       y Nr   r  )r   r   )r!   r#  r5   rh  s    r'   !test_grid_columnconfigure_uniformz*GridTest.test_grid_columnconfigure_uniform  s^    		&&q%&8779EuM77:9EuMr)   c                 
   | j                  t              5  | j                  j                          d d d        | j	                  | j                  j                  d      ddd dd       | j                  t        d      5  | j                  j                  dd       d d d        | j                  j                  dd       | j                  t        d      5  | j                  j                  d       d d d        t        j                  | j                        }|j                  dd	       | j                  j                  d
d       | j                  t        d      5  | j                  j                  d
       d d d        | j	                  | j                  j                  dd      d       | j	                  | j                  j                  dd      d       | j	                  | j                  j                  dd      d       | j                  j                  |d       | j	                  | j                  j                  dd      d       y # 1 sw Y   #xY w# 1 sw Y   xY w# 1 sw Y   {xY w# 1 sw Y   xY wr_  )
r  r  r!   r$  r5   r3   r   r   r1  r3  r4  s     r'   test_grid_rowconfigurezGridTest.test_grid_rowconfigure  s   y) 	*II'')	*44Q7%&qTQO	Q##H.AB 	2II''51	2		##F1#5##H$PR 	0II''/	0 NN499%	q)		##E!#4##H.NO 	/II''.	/44QA1E44QA1E44S(CQG		##Aa#044QA1E'	* 	*	2 	2	0 	0	/ 	/rc  c                    | j                  t        d      5  | j                  j                  dd       d d d        | j                  j                  dd       | j	                  | j                  j                  dd      d       | j	                  | j                  j                  d      d   d       y # 1 sw Y   xY wre  r3   r   r!   r$  r5   rh  s    r'   test_grid_rowconfigure_minsizez'GridTest.test_grid_rowconfigure_minsize  s    ##H.IJ 	:II''5'9	:		##Ar#244Q	BBG44Q7	BBG		: 	:rj  c                    | j                  t        d      5  | j                  j                  dd       d d d        | j                  t        d      5  | j                  j                  dd       d d d        | j                  j                  dd       | j	                  | j                  j                  dd      d       | j	                  | j                  j                  d      d   d       y # 1 sw Y   xY w# 1 sw Y   xY wrl  rz  rh  s    r'   test_grid_rowconfigure_weightz&GridTest.test_grid_rowconfigure_weight  s    ##H.NO 	9II''%'8	9##H /= > 	6II''"'5	6 			##Aa#044QA1E44Q7A1E	9 	9	6 	6rp  c                    | j                  t        d      5  | j                  j                  dd       d d d        | j                  t        d      5  | j                  j                  dd       d d d        | j                  j                  dd       | j	                  | j                  j                  dd      d       | j	                  | j                  j                  d      d   d       y # 1 sw Y   xY w# 1 sw Y   xY wrr  rz  rh  s    r'   test_grid_rowconfigure_padz#GridTest.test_grid_rowconfigure_pad  s    ##H.IJ 	6II''u'5	6##H /= > 	3II''r'2	3 			##A1#-44Q>B44Q7>B	6 	6	3 	3rp  c                     | j                   j                  dd       | j                  | j                   j                  dd      d       | j                  | j                   j                  d      d   d       y ru  )r!   r$  r5   rh  s    r'   test_grid_rowconfigure_uniformz'GridTest.test_grid_rowconfigure_uniform  s^    		##Au#544Q	BEJ44Q7	BEJr)   c           	         t        j                  | j                        }t        j                  | j                        }|j                  ddddddd       | j	                  | j                  j                         |g       |j                          |j                          | j	                  | j                  j                         g        | j	                  |j                         i        |j                  dd       |j                         }| j	                  |d   | j                  d             | j	                  |d	   | j                  d             | j	                  |d
   | j                  d             | j	                  |d   | j                  d             | j	                  |d   | j                  d             | j	                  |d   | j                  d             | j	                  |d   d       y )NrX   rY   r  nsr/  r.  rV  r=  r?   rA   rZ  r   r/  r.  r/  r.  rV  r   r=  r?   rA   rZ  r   )	r   r1  r!   r3  r5   grid_slavesgrid_forgetr2  r   r&   r   r   r   s       r'   test_grid_forgetzGridTest.test_grid_forget  s   NN499%NN499%	Qq!a 	 	6..01#6		..0"5+	Qq){{}ediil3h16i$))A,7l+TYYq\:ftyy|4ftyy|4h,r)   c           	         t        j                  | j                        }t        j                  | j                        }|j                  ddddddd       | j	                  | j                  j                         |g       |j                          |j                          | j	                  | j                  j                         g        | j	                  |j                         i        |j                  dd       |j                         }| j	                  |d   | j                  d             | j	                  |d	   | j                  d             | j	                  |d
   | j                  d             | j	                  |d   | j                  d             | j	                  |d   | j                  d             | j	                  |d   | j                  d             | j	                  |d   d       y )NrX   rY   r  r  r  r   r  r/  r.  rV  r=  r?   rA   rZ  )	r   r1  r!   r3  r5   r  grid_remover2  r   r  s       r'   test_grid_removezGridTest.test_grid_remove  s   NN499%NN499%	Qq!a 	 	6..01#6		..0"5+	Qq){{}ediil3h16i$))A,7l+TYYq\:ftyy|4ftyy|4h.r)   c           	         t        j                  | j                        }| j                  |j	                         i        |j                  ddddddd       |j	                         }| j                  |t               | j                  |d   | j                         | j                  |d   | j                  d             | j                  |d   | j                  d             | j                  |d	   | j                  d             | j                  |d
   | j                  d             | j                  |d   | j                  d             | j                  |d   | j                  d             | j                  |d   d       y )NrX   rY   r  r  r  r   r/  r.  rV  r=  r?   rA   rZ  )	r   r1  r!   r5   r2  r3  r   r   r   )r&   r   r   s      r'   test_grid_infozGridTest.test_grid_info  s<   NN499%+	Qq!a 	 	6{{}dD)dTYY/ediil3h16i$))A,7l+TYYq\:ftyy|4ftyy|4h.r)   c                 `   | j                  t        d      5  | j                  j                  d       d d d        | j                  t        d      5  | j                  j                  d       d d d        | j	                  t
              5  | j                  j                  dd       d d d        | j                  j                  d       | j                  | j                  j                  j                  dd| j                        d       y # 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   ~xY w)	Nzbad anchor "x"ru   r   r   rK   rO   gridrC   )	r3   r   r!   r&  r  r  r5   tkcallrh  s    r'   test_grid_anchorzGridTest.test_grid_anchor  s    ##H.>? 	'II!!#&	'##H.CD 	&II!!"%	&y) 	.II!!$-	.		d#**68TYYGN	' 	'	& 	&	. 	.s#   DD
D$DD!$D-c                    | j                  | j                  j                         d       | j                  | j                  j                  dd      d       | j                  | j                  j                  dddd      d       | j                  t        d      5  | j                  j                  dd       d d d        | j                  t        d      5  | j                  j                  dd       d d d        | j                  t        d      5  | j                  j                  dddd       d d d        | j                  t        d      5  | j                  j                  dddd       d d d        | j                  t              5  | j                  j                  ddddd       d d d        | j                  }|j                  d       |j                  d       t        j                  |ddd	
      }t        j                  |ddd
      }|j                  dd       |j                  dd       | j                  j                          | j                  |j                         d       | j                  |j                  dd      d       | j                  |j                  dddd      d       | j                  |j                  dd      d       | j                  |j                  dddd      d       | j                  |j                  dddd      d       | j                  |j                  dddd      d       y # 1 sw Y   xY w# 1 sw Y   cxY w# 1 sw Y   3xY w# 1 sw Y   xY w# 1 sw Y   xY w)N)r   r   r   r   r   r   zexpected integer but got "x"ru   1x1+0+0r   r   r   r   r   r   r   r   r  )r   r      r  )r   r   r   r   )r   r   r   r   r<   r7     )r  r  r   r   )r5   r!   	grid_bboxr3   r   r  r  r"   r   r$   r3  rD   )r&   r   f1r   s       r'   test_grid_bboxzGridTest.test_grid_bbox  s   ,,.=,,Q2LA,,Q1a8,G##H.LM 	(IIQ'	(##H.LM 	(II3'	(##H.LM 	.II1c1-	.##H.LM 	.II1a-	.y) 	/II1aA.	/II	i 	b]]1Bre<]]1Brf=
a*
a*		(89Q*N;Q1a02BCQ*,<=RQ24DERR4lCRR46FG3	( 	(	( 	(	. 	.	. 	.	/ 	/s<   MMM!M.
 M;MM!M+.M8;Nc                    | j                  t              5  | j                  j                          d d d        | j                  t              5  | j                  j                  d       d d d        | j                  t              5  | j                  j                  ddd       d d d        | j	                  t
        d      5  | j                  j                  dd       d d d        | j	                  t
        d      5  | j                  j                  dd       d d d        | j                  }|j                  d       |j                  d       t        j                  |d	d
dd      }| j                  |j                  dd      d       |j                          | j                  j                          | j                  |j                  dd      d       | j                  |j                  dd      d       | j                  |j                  dd      d       | j                  |j                  dd      d       | j                  |j                  dd      d       | j                  |j                  dd      d       | j                  |j                  d	d      d       | j                  |j                  dd      d       | j                  |j                  dd
      d       | j                  |j                  dd      d       | j                  |j                  dd      d       y # 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   wxY w# 1 sw Y   IxY w)Nr   zbad screen distance "x"ru   r   zbad screen distance "y"r   r  r   r   r   r   )r   r   highlightthicknessr   r<   )r7  r7  r   )r7  r   r7  )r   r7  r   r      )r   r   e   )r   r   r   r   )r  r  r!   grid_locationr3   r   r"   r   r$   r5   r3  rD   )r&   r   r   s      r'   test_grid_locationzGridTest.test_grid_location.  s   y) 	&II##%	&y) 	'II##A&	'y) 	-II##Aq!,	-##H.GH 	.II##C-	.##H.GH 	/II##D#.	/II	i 	bMM!3s-.5:R0(;			c2H=a0':Q/9C0':B/9A.7a0&9a0&9C0&9C0&9c2F;;	& 	&	' 	'	- 	-	. 	.	/ 	/s;   L.L;MM>M".L8;MMM"M,c                    | j                  | j                  j                         d       | j                  t              5  | j                  j                  dd       d d d        | j                  j                  d       | j                  | j                  j                                t        j                  | j                  ddd      }|j                  dd       | j                  j                          | j                  |j                         d       | j                  |j                         d       |j                  d       t        j                  | j                  dd	d
      }|j                  |dd       | j                  j                          | j                  |j                         d       | j                  |j                         d       |j                  d       | j                  j                          | j                  |j                         d       | j                  |j                         d	       y # 1 sw Y   xY w)NTFr   r   r  r   r  r   U   r   )rf   r/  r.  )r5   r!   r%  r  r  r
  r   r$   r3  rD   r   r   )r&   r   gs      r'   test_grid_propagatezGridTest.test_grid_propagateN  s   113T:y) 	3II$$UE2	3		  '1134MM$))3suE	Qq)		#.)3/	MM$))2bWE	QAa0		#.)3/			"-)2.%	3 	3s    IIc                    | j                  t              5  | j                  j                  d       d d d        | j	                  | j                  j                         d       t        j                  | j                        }|j                  dd       | j	                  | j                  j                         d       |j                  dd       | j	                  | j                  j                         d       y # 1 sw Y   xY w)Nr   r  r  r  r  r;   )   r;   )r  r  r!   r!  r5   r   Scaler3  r\  s     r'   test_grid_sizezGridTest.test_grid_sized  s    y) 	#II"	#,,.7MM$))$	Qq),,.7	Qq),,.7	# 	#s   C>>Dc                    | j                  | j                  j                         g        t        j                  | j                        }|j                  dd       t        j                  | j                        }|j                  dd       t        j                  | j                        }|j                  dd       t        j                  | j                        }|j                  dd       | j                  | j                  j                         ||||g       | j                  | j                  j                  d      |g       | j                  | j                  j                  d      |||g       | j                  | j                  j                  d      |g       | j                  | j                  j                  d      |||g       | j                  | j                  j                  dd      ||g       y )Nr   r   r  r0  r8  )r5   r!   r  r   Labelr3  )r&   r   r   r   r   s        r'   test_grid_slaveszGridTest.test_grid_slavesn  s   ..0"5MM$))$	Qq)MM$))$	Qq)MM$))$	Qq)MM$))$	Qq)..01aA,?..1.5s;..1.51ayA..a.81#>..a.81a)D..1Q.?!QHr)   )$r   r   r   r   r(  r5  r:  r>  r@  rF  rJ  rN  rR  rT  rW  r]  rb  ri  ro  rs  rv  rx  r{  r}  r  r  r  r  r  r  r  r  r  r  r  __classcell__)r,  s   @r'   r  r    s    I	=@D	9	N	NNN=A:I,KIFN
F,HFCK
-(/(/ OH><@/,8Ir)   r  __main__)unittestr   r   r   test.supportr   test.test_tkinter.supportr   test.test_tkinter.widget_testsr   TestCaser	   r   r  	tests_guir   mainrl   r)   r'   <module>r     s     	   ! 1 = G5!8#4#4 G5TJ "H$5$5 J ZYI!8#4#4 YIz i	 zHMMO r)   