
    i                       d dl Z d dlZd dlmZmZ d dlZd dlZd dlmZm	Z	 d dl
mZ d ej                         k(  ZdZdZd Z G d	 d
ej"                        Z G d dej"                        Zedk(  r ej*                          yy)    N)
CollectionSequence)RectVector2)
test_utilsPyPyi   ic                  >    t        j                  t        t              S N)randomrandint_int_min_int_max     `/home/obispo/Crisostomo_bridge/mision_env/lib/python3.12/site-packages/pygame/tests/rect_test.py_random_intr      s    >>(H--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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/d. Z0d/ Z1d0 Z2d1 Z3d2 Z4d3 Z5d4 Z6d5 Z7d6 Z8d7 Z9d8 Z:d9 Z;d: Z<d; Z=d< Z>d= Z?d> Z@d? ZAd@ ZBdA ZCdB ZDdC ZEdD ZFdE ZGdF ZHdG ZIdH ZJdI ZKdJ ZLdK ZMdL ZNdM ZOdN ZPdO ZQdP ZRdQ ZSdR ZTdS ZUdT ZVdU ZWdV ZXdW ZYdX ZZdY Z[dZ Z\d[ Z]d\ Z^d] Z_d^ Z`d_ Zad` Zbda Zcdb Zddc Zedd Zfde Zgdf Zhdg Zidh Zjdi Zkdj Zldk Zmdl Zndm Zodn Zpdo Zqdp Zrdq Zsdr Ztds Zudt Zvdu Zwdv Zxdw Zy ezj                  e|dx      dy        Z}dz Z~d{ Zd| Zd} Zd~ Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Z G d d      Z G d d      Z G d d      Z G d d      Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zy)RectTypeTestc                 (     | j                   |i | y r
   )assertCountEqual)selfargskwargss      r   _assertCountEqualzRectTypeTest._assertCountEqual   s    t.v.r   c                     t        dddd      }| j                  d|j                         | j                  d|j                         | j                  d|j                         | j                  d|j
                         y N            r   assertEquallefttopwidthheightr   rs     r   testConstructionXYWidthHeightz*RectTypeTest.testConstructionXYWidthHeight   sb    Aq!AFF#AEE"AGG$AHH%r   c                     t        dd      }| j                  d|j                         | j                  d|j                         | j                  d|j                         | j                  d|j
                         y )Nr   r   r   r    r   r   r   r    r!   r'   s     r   testConstructionTopLeftSizez(RectTypeTest.testConstructionTopLeftSize    s^     AFF#AEE"AGG$AHH%r   c                    t        dddd      }| j                  |j                  |j                  z   |j                         | j                  |j
                  |j                  z   |j                         | j                  |j                  |j                  f|j                         | j                  |j                  |j
                  f|j                         | j                  |j                  |j
                  f|j                         | j                  |j                  |j                  f|j                         | j                  |j                  |j                  f|j                         |j                  |j                  dz  z   }|j
                  |j                  dz  z   }| j                  ||j                         | j                  ||j                         | j                  |j                  |j                  f|j                         | j                  |j                  |j
                  f|j                          | j                  |j                  |j                  f|j"                         | j                  |j                  |j                  f|j$                         | j                  |j                  |j                  f|j&                         y r   )r   r"   r#   r%   rightr$   r&   bottomsizetoplefttopright
bottomleftbottomrightcenterxcenterycentermidtop	midbottommidleftmidright)r   r(   midxmidys       r   testCalculatedAttributesz%RectTypeTest.testCalculatedAttributes'   s   Aq!!'')1773)1884!''188,aff5!&&!%%!))4!''155)1::6!&&!((+Q\\:!''188,amm<vv1$uuqxx1}$qyy)qyy)!))QYY/:!))QUU+QXX6!))QXX.<!&&!)),aii8!''199-qzz:r   c                     t        dddd      }|j                         }t        |      D ]  \  }}| j                  ||   |        y )N2   d         )r   __iter__	enumerater"   )r   rectrect_iteratorivals        r   test_rect_iterzRectTypeTest.test_rect_iter=   sK    BS#& . 	+FAsT!Wc*	+r   c                     t        dd      }|j                  |j                  z   |j                  |j                  z   f|j                   |j                   ff}|j                          | j                  ||       y)z@Ensures normalize works when width and height are both negative.r+   )Nr   xwyh	normalizer"   r   	test_rectexpected_normalized_rects      r   test_normalizezRectTypeTest.test_normalizeE   sk    *	[[9;;&	ikk(ABkk\IKK<($
 
 	$<=r   c                     t        dd      }|j                  |j                  z   |j                  f|j                   |j                  ff}|j                          | j                  ||       y)zDEnsures normalize works with a negative width and a positive height.r+   )rM      NrO   rU   s      r   test_normalize__positive_heightz,RectTypeTest.test_normalize__positive_heightQ   `    )	[[9;;&	4kk\9;;'$
 
 	$<=r   c                     t        dd      }|j                  |j                  |j                  z   f|j                  |j                   ff}|j                          | j                  ||       y)zDEnsures normalize works with a positive width and a negative height.r+   )r   rN   Nr   rP   rR   rS   rQ   rT   r"   rU   s      r   test_normalize__positive_widthz+RectTypeTest.test_normalize__positive_width]   `    )	[[)++	34[[9;;,'$
 
 	$<=r   c                     t        dd      }|j                  |j                  z   |j                  f|j                   |j                  ff}|j                          | j                  ||       y)z@Ensures normalize works with a negative width and a zero height.r+   )rM   r   NrO   rU   s      r   test_normalize__zero_heightz(RectTypeTest.test_normalize__zero_heighti   r\   r   c                     t        dd      }|j                  |j                  |j                  z   f|j                  |j                   ff}|j                          | j                  ||       y)z@Ensures normalize works with a zero width and a negative height.r+   )r   rN   Nr^   rU   s      r   test_normalize__zero_widthz'RectTypeTest.test_normalize__zero_widthu   r`   r   c                     dD ];  }t        d|      }t        |      }|j                          | j                  ||       = y)zEnsures normalize works when width and height are both non-negative.

        Tests combinations of positive and zero values for width and height.
        The normalize method has no impact when both width and height are
        non-negative.
        ))r   rZ   )r   r   )r   rZ   r   r   r+   N)r   rT   r"   )r   r1   rV   rW   s       r   test_normalize__non_negativez)RectTypeTest.test_normalize__non_negative   sH     5 	BDVT*I'+I$!Y(@A	Br   c                 .   d}d}d}t        d|f|      }||_        | j                  |j                  |       | j                  |j                  |j                         | j                  |j                  |       | j                  |j
                  |       y)zeEnsures changing the x attribute moves the rect and does not change
        the rect's size.
        
   r   r,   r   N)r   rP   r"   r#   rR   r1   r   
expected_x
expected_yexpected_sizer(   s        r   test_xzRectTypeTest.test_x   s~     

!Z-0j)aff%j)/r   c                     t        dddd      }dg ddg dfD ]'  }| j                  t              5  ||_        ddd       ) y# 1 sw Y   4xY w)z9Ensures the x attribute handles invalid values correctly.r   r   N1r   r   r   r   )r   assertRaises	TypeErrorrP   r   r(   values      r   test_x__invalid_valuez"RectTypeTest.test_x__invalid_value   [    Aq!BT95 	E""9-  	    AA	c                 x    t        dddd      }| j                  t              5  |`ddd       y# 1 sw Y   yxY w)z)Ensures the x attribute can't be deleted.r   r   N)r   rs   AttributeErrorrP   r'   s     r   test_x__delzRectTypeTest.test_x__del   :    Aq!~. 		 	 	   09c                 .   d}d}d}t        |df|      }||_        | j                  |j                  |       | j                  |j                  |j                         | j                  |j                  |       | j                  |j
                  |       y)zeEnsures changing the y attribute moves the rect and does not change
        the rect's size.
        r      r,   r   N)r   rR   r"   r$   rP   r1   rj   s        r   test_yzRectTypeTest.test_y   s~     

*a-0j)aee$j)/r   c                     t        dddd      }dg ddg dfD ]'  }| j                  t              5  ||_        ddd       ) y# 1 sw Y   4xY w)z9Ensures the y attribute handles invalid values correctly.r   r   Nrp   rq   rr   )r   rs   rt   rR   ru   s      r   test_y__invalid_valuez"RectTypeTest.test_y__invalid_value   rx   ry   c                 x    t        dddd      }| j                  t              5  |`ddd       y# 1 sw Y   yxY w)z)Ensures the y attribute can't be deleted.r   r   N)r   rs   r{   rR   r'   s     r   test_y__delzRectTypeTest.test_y__del   r}   r~   c                     t        dddd      }d}||_        | j                  ||j                         | j                  t        |ddd      |       y)z`Changing the left attribute moves the rect and does not change
        the rect's width
        r   r   r   r    ri   N)r   r#   r"   )r   r(   new_lefts      r   	test_leftzRectTypeTest.test_left   sO     Aq!166*h1a0!4r   c                     t        dddd      }dg ddg dfD ]'  }| j                  t              5  ||_        ddd       ) y# 1 sw Y   4xY w)z<Ensures the left attribute handles invalid values correctly.r   r   Nrp   rq   rr   )r   rs   rt   r#   ru   s      r   test_left__invalid_valuez%RectTypeTest.test_left__invalid_value   s[    Aq!BT95 	E""9-  	 ry   c                 x    t        dddd      }| j                  t              5  |`ddd       y# 1 sw Y   yxY w)z,Ensures the left attribute can't be deleted.r   r   N)r   rs   r{   r#   r'   s     r   test_left__delzRectTypeTest.test_left__del   :    Aq!~. 		 	 	r~   c                 *   t        dddd      }|j                  dz   }|j                  dz   }|j                  }||_        | j	                  ||j                         | j	                  ||j                         | j	                  ||j                         y)zaChanging the right attribute moves the rect and does not change
        the rect's width
        r   r   r   r    r   N)r   r/   r#   r%   r"   )r   r(   	new_rightexpected_left	old_widths        r   
test_rightzRectTypeTest.test_right   sz     Aq!GGbL	GG	AGG,/AGG,r   c                     t        dddd      }dg ddg dfD ]'  }| j                  t              5  ||_        ddd       ) y# 1 sw Y   4xY w)z=Ensures the right attribute handles invalid values correctly.r   r   Nrp   rq   rr   )r   rs   rt   r/   ru   s      r   test_right__invalid_valuez&RectTypeTest.test_right__invalid_value   [    Aq!BT95 	 E""9-     	    ry   c                 x    t        dddd      }| j                  t              5  |`ddd       y# 1 sw Y   yxY w)z-Ensures the right attribute can't be deleted.r   r   N)r   rs   r{   r/   r'   s     r   test_right__delzRectTypeTest.test_right__del   :    Aq!~. 		 	 	r~   c                     t        dddd      }d}||_        | j                  t        d|dd      |       | j                  ||j                         y)z_Changing the top attribute moves the rect and does not change
        the rect's width
        r   r   r   r    ri   N)r   r$   r"   )r   r(   new_tops      r   test_topzRectTypeTest.test_top  sO     Aq!a!Q/3!%%(r   c                     t        dddd      }dg ddg dfD ]'  }| j                  t              5  ||_        ddd       ) y# 1 sw Y   4xY w)z;Ensures the top attribute handles invalid values correctly.r   r   Nrp   rq   rr   )r   rs   rt   r$   ru   s      r   test_top__invalid_valuez$RectTypeTest.test_top__invalid_value  s[    Aq!BT95 	E""9-  	 ry   c                 x    t        dddd      }| j                  t              5  |`ddd       y# 1 sw Y   yxY w)z+Ensures the top attribute can't be deleted.r   r   N)r   rs   r{   r$   r'   s     r   test_top__delzRectTypeTest.test_top__del  s:    Aq!~. 		 	 	r~   c                 *   t        dddd      }|j                  dz   }|j                  dz   }|j                  }||_        | j	                  ||j                         | j	                  ||j                         | j	                  ||j                         y)zcChanging the bottom attribute moves the rect and does not change
        the rect's height
        r   r   r   r    r   N)r   r0   r$   r&   r"   )r   r(   
new_bottomexpected_top
old_heights        r   test_bottomzRectTypeTest.test_bottom  sz     Aq!XX]
uurzXX
QXX.quu-QXX.r   c                     t        dddd      }dg ddg dfD ]'  }| j                  t              5  ||_        ddd       ) y# 1 sw Y   4xY w)z>Ensures the bottom attribute handles invalid values correctly.r   r   Nrp   rq   rr   )r   rs   rt   r0   ru   s      r   test_bottom__invalid_valuez'RectTypeTest.test_bottom__invalid_value-  [    Aq!BT95 	!E""9- ! ! !	!! !ry   c                 x    t        dddd      }| j                  t              5  |`ddd       y# 1 sw Y   yxY w)z.Ensures the bottom attribute can't be deleted.r   r   N)r   rs   r{   r0   r'   s     r   test_bottom__delzRectTypeTest.test_bottom__del5  :    Aq!~. 		 	 	r~   c                 *   t        dddd      }|j                  dz   }|j                  dz   }|j                  }||_        | j	                  ||j                         | j	                  ||j                         | j	                  ||j                         y)zcChanging the centerx attribute moves the rect and does not change
        the rect's width
        r   r   r   r    r   N)r   r6   r#   r%   r"   )r   r(   new_centerxr   r   s        r   test_centerxzRectTypeTest.test_centerx<  sz     Aq!ii"nGG		aii0/AGG,r   c                     t        dddd      }dg ddg dfD ]'  }| j                  t              5  ||_        ddd       ) y# 1 sw Y   4xY w)z?Ensures the centerx attribute handles invalid values correctly.r   r   Nrp   rq   rr   )r   rs   rt   r6   ru   s      r   test_centerx__invalid_valuez(RectTypeTest.test_centerx__invalid_valueJ  [    Aq!BT95 	"E""9- "!	" "	"" "ry   c                 x    t        dddd      }| j                  t              5  |`ddd       y# 1 sw Y   yxY w)z/Ensures the centerx attribute can't be deleted.r   r   N)r   rs   r{   r6   r'   s     r   test_centerx__delzRectTypeTest.test_centerx__delR  :    Aq!~. 			 	 	r~   c                 *   t        dddd      }|j                  dz   }|j                  dz   }|j                  }||_        | j	                  ||j                         | j	                  ||j                         | j	                  ||j                         y)zcChanging the centery attribute moves the rect and does not change
        the rect's width
        r   r   r   r    r   N)r   r7   r$   r&   r"   )r   r(   new_centeryr   r   s        r   test_centeryzRectTypeTest.test_centeryY  sz     Aq!ii"nuurzXX
	aii0quu-QXX.r   c                     t        dddd      }dg ddg dfD ]'  }| j                  t              5  ||_        ddd       ) y# 1 sw Y   4xY w)z?Ensures the centery attribute handles invalid values correctly.r   r   Nrp   rq   rr   )r   rs   rt   r7   ru   s      r   test_centery__invalid_valuez(RectTypeTest.test_centery__invalid_valueg  r   ry   c                 x    t        dddd      }| j                  t              5  |`ddd       y# 1 sw Y   yxY w)z/Ensures the centery attribute can't be deleted.r   r   N)r   rs   r{   r7   r'   s     r   test_centery__delzRectTypeTest.test_centery__delo  r   r~   c                     t        dddd      }|j                  dz   |j                  dz   f}|j                  }||_        | j                  ||j                         | j                  ||j                         y)zbChanging the topleft attribute moves the rect and does not change
        the rect's size
        r   r   r   r    r      N)r   r#   r$   r1   r2   r"   )r   r(   new_topleftold_sizes       r   test_topleftzRectTypeTest.test_topleftv  sf     Aq!vv{AEEBJ/66	aii0166*r   c                     t        dddd      }dg dddg dfD ]'  }| j                  t              5  ||_        ddd       ) y# 1 sw Y   4xY w)z?Ensures the topleft attribute handles invalid values correctly.r   r   Nrp   rq   rr   )r   rs   rt   r2   ru   s      r   test_topleft__invalid_valuez(RectTypeTest.test_topleft__invalid_value  ]    Aq!BQi8 	"E""9- "!	" "	"" "   AA	c                 x    t        dddd      }| j                  t              5  |`ddd       y# 1 sw Y   yxY w)z/Ensures the topleft attribute can't be deleted.r   r   N)r   rs   r{   r2   r'   s     r   test_topleft__delzRectTypeTest.test_topleft__del  r   r~   c                 f   t        dddd      }|j                  dz   |j                  dz   f}|j                  dz   |j                  dz   f}|j                  }||_        | j                  ||j
                         | j                  ||j                         | j                  ||j                         y)zeChanging the bottomleft attribute moves the rect and does not change
        the rect's size
        r   r   r   r    r   r   N)r   r#   r0   r$   r1   r4   r"   r2   )r   r(   new_bottomleftexpected_topleftr   s        r   test_bottomleftzRectTypeTest.test_bottomleft  s     Aq!&&2+qxx"}5FFRK466%6)1995166*r   c                     t        dddd      }dg dddg dfD ]'  }| j                  t              5  ||_        ddd       ) y# 1 sw Y   4xY w)zBEnsures the bottomleft attribute handles invalid values correctly.r   r   Nrp   rq   rr   )r   rs   rt   r4   ru   s      r   test_bottomleft__invalid_valuez+RectTypeTest.test_bottomleft__invalid_value  s]    Aq!BQi8 	%E""9- %$% %	%% %r   c                 x    t        dddd      }| j                  t              5  |`ddd       y# 1 sw Y   yxY w)z2Ensures the bottomleft attribute can't be deleted.r   r   N)r   rs   r{   r4   r'   s     r   test_bottomleft__delz!RectTypeTest.test_bottomleft__del  s:    Aq!~. 		 	 	r~   c                 f   t        dddd      }|j                  dz   |j                  dz   f}|j                  dz   |j                  dz   f}|j                  }||_        | j                  ||j
                         | j                  ||j                         | j                  ||j                         y)zcChanging the topright attribute moves the rect and does not change
        the rect's size
        r   r   r   r    r   r   N)r   r/   r$   r#   r1   r3   r"   r2   )r   r(   new_toprightr   r   s        r   test_toprightzRectTypeTest.test_topright  s     Aq!"aeebj1FFRK466!
qzz2)1995166*r   c                     t        dddd      }dg dddg dfD ]'  }| j                  t              5  ||_        ddd       ) y# 1 sw Y   4xY w)z@Ensures the topright attribute handles invalid values correctly.r   r   Nrp   rq   rr   )r   rs   rt   r3   ru   s      r   test_topright__invalid_valuez)RectTypeTest.test_topright__invalid_value  ]    Aq!BQi8 	#E""9- #"
# #	## #r   c                 x    t        dddd      }| j                  t              5  |`ddd       y# 1 sw Y   yxY w)z0Ensures the topright attribute can't be deleted.r   r   N)r   rs   r{   r3   r'   s     r   test_topright__delzRectTypeTest.test_topright__del  :    Aq!~. 	
	 	 	r~   c                 f   t        dddd      }|j                  dz   |j                  dz   f}|j                  dz   |j                  dz   f}|j
                  }||_        | j                  ||j                         | j                  ||j                         | j                  ||j
                         y)zfChanging the bottomright attribute moves the rect and does not change
        the rect's size
        r   r   r   r    r   r   N)	r   r/   r0   r#   r$   r1   r5   r"   r2   )r   r(   new_bottomrightr   r   s        r   test_bottomrightzRectTypeTest.test_bottomright  s     Aq!77R<B7FFRK466'!--8)1995166*r   c                     t        dddd      }dg dddg dfD ]'  }| j                  t              5  ||_        ddd       ) y# 1 sw Y   4xY w)zCEnsures the bottomright attribute handles invalid values correctly.r   r   Nrp   rq   rr   )r   rs   rt   r5   ru   s      r   test_bottomright__invalid_valuez,RectTypeTest.test_bottomright__invalid_value  s]    Aq!BQi8 	&E""9- & %& &	&& &r   c                 x    t        dddd      }| j                  t              5  |`ddd       y# 1 sw Y   yxY w)z3Ensures the bottomright attribute can't be deleted.r   r   N)r   rs   r{   r5   r'   s     r   test_bottomright__delz"RectTypeTest.test_bottomright__del  s:    Aq!~. 		 	 	r~   c                 f   t        dddd      }|j                  dz   |j                  dz   f}|j                  dz   |j                  dz   f}|j
                  }||_        | j                  ||j                         | j                  ||j                         | j                  ||j
                         y)zaChanging the center attribute moves the rect and does not change
        the rect's size
        r   r   r   r    r   r   N)	r   r6   r7   r#   r$   r1   r8   r"   r2   )r   r(   
new_centerr   r   s        r   test_centerzRectTypeTest.test_center  s     Aq!ii"naii"n5
FFRK466QXX.)1995166*r   c                     t        dddd      }dg dddg dfD ]'  }| j                  t              5  ||_        ddd       ) y# 1 sw Y   4xY w)z>Ensures the center attribute handles invalid values correctly.r   r   Nrp   rq   rr   )r   rs   rt   r8   ru   s      r   test_center__invalid_valuez'RectTypeTest.test_center__invalid_value  ]    Aq!BQi8 	!E""9- ! ! !	!! !r   c                 x    t        dddd      }| j                  t              5  |`ddd       y# 1 sw Y   yxY w)z.Ensures the center attribute can't be deleted.r   r   N)r   rs   r{   r8   r'   s     r   test_center__delzRectTypeTest.test_center__del  r   r~   c                 f   t        dddd      }|j                  dz   |j                  dz   f}|j                  dz   |j                  dz   f}|j                  }||_        | j                  ||j
                         | j                  ||j                         | j                  ||j                         y)zbChanging the midleft attribute moves the rect and does not change
        the rect's size
        r   r   r   r    r   r   N)r   r#   r7   r$   r1   r;   r"   r2   )r   r(   new_midleftr   r   s        r   test_midleftzRectTypeTest.test_midleft  s     Aq!vv{AIIN3FFRK466	aii0)1995166*r   c                     t        dddd      }dg dddg dfD ]'  }| j                  t              5  ||_        ddd       ) y# 1 sw Y   4xY w)z?Ensures the midleft attribute handles invalid values correctly.r   r   Nrp   rq   rr   )r   rs   rt   r;   ru   s      r   test_midleft__invalid_valuez(RectTypeTest.test_midleft__invalid_value  r   r   c                 x    t        dddd      }| j                  t              5  |`ddd       y# 1 sw Y   yxY w)z/Ensures the midleft attribute can't be deleted.r   r   N)r   rs   r{   r;   r'   s     r   test_midleft__delzRectTypeTest.test_midleft__del  r   r~   c                 f   t        dddd      }|j                  dz   |j                  dz   f}|j                  dz   |j                  dz   f}|j
                  }||_        | j                  ||j                         | j                  ||j                         | j                  ||j
                         y)zcChanging the midright attribute moves the rect and does not change
        the rect's size
        r   r   r   r    r   r   N)	r   r/   r7   r#   r$   r1   r<   r"   r2   )r   r(   new_midrightr   r   s        r   test_midrightzRectTypeTest.test_midright"  s     Aq!"aii"n5FFRK466!
qzz2)1995166*r   c                     t        dddd      }dg dddg dfD ]'  }| j                  t              5  ||_        ddd       ) y# 1 sw Y   4xY w)z@Ensures the midright attribute handles invalid values correctly.r   r   Nrp   rq   rr   )r   rs   rt   r<   ru   s      r   test_midright__invalid_valuez)RectTypeTest.test_midright__invalid_value0  r   r   c                 x    t        dddd      }| j                  t              5  |`ddd       y# 1 sw Y   yxY w)z0Ensures the midright attribute can't be deleted.r   r   N)r   rs   r{   r<   r'   s     r   test_midright__delzRectTypeTest.test_midright__del8  r   r~   c                 f   t        dddd      }|j                  dz   |j                  dz   f}|j                  dz   |j                  dz   f}|j                  }||_        | j                  ||j
                         | j                  ||j                         | j                  ||j                         y)zaChanging the midtop attribute moves the rect and does not change
        the rect's size
        r   r   r   r    r   r   N)r   r6   r$   r#   r1   r9   r"   r2   )r   r(   
new_midtopr   r   s        r   test_midtopzRectTypeTest.test_midtop?  s     Aq!ii"naeebj1
FFRK466QXX.)1995166*r   c                     t        dddd      }dg dddg dfD ]'  }| j                  t              5  ||_        ddd       ) y# 1 sw Y   4xY w)z>Ensures the midtop attribute handles invalid values correctly.r   r   Nrp   rq   rr   )r   rs   rt   r9   ru   s      r   test_midtop__invalid_valuez'RectTypeTest.test_midtop__invalid_valueM  r   r   c                 x    t        dddd      }| j                  t              5  |`ddd       y# 1 sw Y   yxY w)z.Ensures the midtop attribute can't be deleted.r   r   N)r   rs   r{   r9   r'   s     r   test_midtop__delzRectTypeTest.test_midtop__delU  r   r~   c                 f   t        dddd      }|j                  dz   |j                  dz   f}|j                  dz   |j                  dz   f}|j
                  }||_        | j                  ||j                         | j                  ||j                         | j                  ||j
                         y)zdChanging the midbottom attribute moves the rect and does not change
        the rect's size
        r   r   r   r    r   r   N)	r   r6   r0   r#   r$   r1   r:   r"   r2   )r   r(   new_midbottomr   r   s        r   test_midbottomzRectTypeTest.test_midbottom\  s     Aq!RB7FFRK466#4)1995166*r   c                     t        dddd      }dg dddg dfD ]'  }| j                  t              5  ||_        ddd       ) y# 1 sw Y   4xY w)zAEnsures the midbottom attribute handles invalid values correctly.r   r   Nrp   rq   rr   )r   rs   rt   r:   ru   s      r   test_midbottom__invalid_valuez*RectTypeTest.test_midbottom__invalid_valuej  s]    Aq!BQi8 	$E""9- $#$ $	$$ $r   c                 x    t        dddd      }| j                  t              5  |`ddd       y# 1 sw Y   yxY w)z1Ensures the midbottom attribute can't be deleted.r   r   N)r   rs   r{   r:   r'   s     r   test_midbottom__delz RectTypeTest.test_midbottom__delr  s:    Aq!~. 		 	 	r~   c                 
   t        dddd      }d}|j                  }|j                  }||_        | j	                  ||j                         | j	                  ||j                         | j	                  ||j                         y)z<Changing the width resizes the rect from the top-left cornerr   r   r   r    ri   N)r   r2   r&   r%   r"   )r   r(   	new_widthold_topleftr   s        r   
test_widthzRectTypeTest.test_widthy  sl    Aq!	iiXX
AGG,QXX.aii0r   c                     t        dddd      }dg ddg dfD ]'  }| j                  t              5  ||_        ddd       ) y# 1 sw Y   4xY w)z=Ensures the width attribute handles invalid values correctly.r   r   Nrp   rq   rr   )r   rs   rt   r%   ru   s      r   test_width__invalid_valuez&RectTypeTest.test_width__invalid_value  r   ry   c                 x    t        dddd      }| j                  t              5  |`ddd       y# 1 sw Y   yxY w)z-Ensures the width attribute can't be deleted.r   r   N)r   rs   r{   r%   r'   s     r   test_width__delzRectTypeTest.test_width__del  r   r~   c                 
   t        dddd      }d}|j                  }|j                  }||_        | j	                  ||j                         | j	                  ||j                         | j	                  ||j                         y)z=Changing the height resizes the rect from the top-left cornerr   r   r   r    ri   N)r   r2   r%   r&   r"   )r   r(   
new_heightr  r   s        r   test_heightzRectTypeTest.test_height  sl    Aq!
iiGG	QXX.AGG,aii0r   c                     t        dddd      }dg ddg dfD ]'  }| j                  t              5  ||_        ddd       ) y# 1 sw Y   4xY w)z>Ensures the height attribute handles invalid values correctly.r   r   Nrp   rq   rr   )r   rs   rt   r&   ru   s      r   test_height__invalid_valuez'RectTypeTest.test_height__invalid_value  r   ry   c                 x    t        dddd      }| j                  t              5  |`ddd       y# 1 sw Y   yxY w)z.Ensures the height attribute can't be deleted.r   r   N)r   rs   r{   r&   r'   s     r   test_height__delzRectTypeTest.test_height__del  r   r~   c                     t        dddd      }d}|j                  }||_        | j                  ||j                         | j                  ||j                         y)z;Changing the size resizes the rect from the top-left cornerr   r   r   r    ri   r   N)r   r2   r1   r"   )r   r(   new_sizer  s       r   	test_sizezRectTypeTest.test_size  sO    Aq!ii166*aii0r   c                     t        dddd      }dg dddg dfD ]'  }| j                  t              5  ||_        ddd       ) y# 1 sw Y   4xY w)z<Ensures the size attribute handles invalid values correctly.r   r   Nrp   rq   rr   )r   rs   rt   r1   ru   s      r   test_size__invalid_valuez%RectTypeTest.test_size__invalid_value  s]    Aq!BQi8 	E""9-  	 r   c                 x    t        dddd      }| j                  t              5  |`ddd       y# 1 sw Y   yxY w)z,Ensures the size attribute can't be deleted.r   r   N)r   rs   r{   r1   r'   s     r   test_size__delzRectTypeTest.test_size__del  r   r~   c           
         t        dddd      }| j                  |j                  t        dddd            d       | j                  t        dddd      |v d       | j                  |j                  t        |            d       | j                  |t        |      v d       | j                  |j                  t        dddd            d	       | j                  t        dddd      |v d	       | j                  |j                  t        dddd            d
       | j                  |j                  t        dddd            d       | j                  |j                  t        dddd            d       | j                  t        dddd      |v d
       | j                  t        dddd      |v d       | j                  t        dddd      |v d       | j                  dt        dddd      v d       | j                  dt        dddd      v d       | j	                  t
        d        | j	                  t
        d        y )Nr   r   r   r    z#r does not contain Rect(2, 3, 1, 1)z%r does not contain Rect(2, 3, 1, 1) 2z*r does not contain the same rect as itselfr   z2r does not contain an empty rect within its boundszr contains Rect(0, 0, 1, 2)rZ   zr contains Rect(4, 6, 1, 1)zr contains Rect(4, 6, 0, 0)zr does not contain 2zr contains 3c                  "    dt        dddd      v S )Nstringr   r   r   r   r   r   r   <lambda>z,RectTypeTest.test_contains.<locals>.<lambda>  s    XaAq9I-I r   c                  "    dt        dddd      v S )Ny      @      @r   r   r   r  r   r   r   r  z,RectTypeTest.test_contains.<locals>.<lambda>  s    VtAq!Q7G-G r   )r   
assertTruecontainsassertFalsers   rt   r'   s     r   test_containszRectTypeTest.test_contains  s   Aq!JJtAq!Q'(*O	
 	Q1a(A-/VWJJtAw!M	
 	T!W&RSJJtAq!Q'(@	
 	Aq!!@	
 	DAq!$457TUDAq!$457TUDAq!$457TUaAq)Q.0MNaAq)Q.0MNaAq)Q.0MNT!Q1--/EFd1aA..?)%IJ)%GHr   c                    t        dddd      }| j                  |j                  |j                  |j                        d       | j                  |j                  |j                  dz
  |j                        d       | j                  |j                  |j                  |j                  dz
        d       | j                  |j                  |j                  dz
  |j                  dz
        d       | j                  |j                  |j                  dz
  |j                  dz
        d	       | j                  |j                  |j                  |j                        d
       | j                  |j                  |j                  dz
  |j                        d       | j                  |j                  |j                  |j                  dz
        d       y )Nr   r   r   r    z)r does not collide with point (left, top)z%r collides with point (left - 1, top)z%r collides with point (left, top - 1)z)r collides with point (left - 1, top - 1)z5r does not collide with point (right - 1, bottom - 1)z%r collides with point (right, bottom)z)r collides with point (right - 1, bottom)z)r collides with point (right, bottom - 1))r   r  collidepointr#   r$   r!  r/   r0   r'   s     r   test_collidepointzRectTypeTest.test_collidepoint  st   Aq!NN166155)+V	
 	NN166A:quu-/V	
 	NN16615519-/V	
 	NN166A:quuqy17	

 	NN177Q;15C	
 	NN177AHH-/V	
 	NN177Q;17	
 	NN177AHHqL17	
r   c                 |   t        dddd      }|j                  dd      }| j                  |j                  |j                         | j                  |j                  dz
  |j                         | j                  |j
                  dz
  |j
                         | j                  |j                  dz   |j                         | j                  |j                  dz   |j                         | j                  |j                  dz   |j                         | j                  |j                  dz   |j                         y)>The inflate method inflates around the center of the rectangler   r    rZ      r   N
r   inflater"   r8   r#   r$   r/   r0   r%   r&   r   r(   r2s      r   test_inflate__largerz!RectTypeTest.test_inflate__larger  s    Aq!YYq!_299-!RWW-BFF+1bhh/Aryy11bhh/Aryy1r   c                 |   t        dddd      }|j                  dd      }| j                  |j                  |j                         | j                  |j                  dz   |j                         | j                  |j
                  dz   |j
                         | j                  |j                  dz
  |j                         | j                  |j                  dz
  |j                         | j                  |j                  dz
  |j                         | j                  |j                  dz
  |j                         y	r'  r   r    rZ   r(  rN   r   Nr)  r+  s      r   test_inflate__smallerz"RectTypeTest.test_inflate__smaller  s    Aq!YYr2299-!RWW-BFF+1bhh/Aryy11bhh/Aryy1r   c                    t        dddd      }t        |      }|j                  dd       | j                  |j                  |j                         | j                  |j                  dz   |j                         | j                  |j
                  dz   |j
                         | j                  |j                  dz
  |j                         | j                  |j                  dz
  |j                         | j                  |j                  dz
  |j                         | j                  |j                  dz
  |j                         y)	zAThe inflate_ip method inflates around the center of the rectangler   r    rZ   r(  r0  rN   r   N
r   
inflate_ipr"   r8   r#   r$   r/   r0   r%   r&   r+  s      r   test_inflate_ip__largerz$RectTypeTest.test_inflate_ip__larger"      Aq!!W
b"299-!RWW-BFF+1bhh/Aryy11bhh/Aryy1r   c                    t        dddd      }t        |      }|j                  dd       | j                  |j                  |j                         | j                  |j                  dz   |j                         | j                  |j
                  dz   |j
                         | j                  |j                  dz
  |j                         | j                  |j                  dz
  |j                         | j                  |j                  dz
  |j                         | j                  |j                  dz
  |j                         yr/  r3  r+  s      r   test_inflate_ip__smallerz%RectTypeTest.test_inflate_ip__smaller0  r6  r   c                 z   t        dddd      }|j                  d      }| j                  |j                  |j                         | j                  |j                  dz
  |j                         | j                  |j
                  dz
  |j
                         | j                  |j                  dz   |j                         | j                  |j                  dz   |j                         | j                  |j                  dz  |j                         | j                  |j                  dz  |j                         y:The scale method scales around the center of the rectangler   r    rZ   r(  r   N
r   scale_byr"   r8   r#   r$   r/   r0   r%   r&   r+  s      r   %test_scale_by__larger_single_argumentz2RectTypeTest.test_scale_by__larger_single_argument>  s    Aq!ZZ]299-!RWW-BFF+1bhh/Aryy11bhh/Aryy1r   c                 |   t        dddd      }|j                  d      }| j                  |j                  |j                         | j                  |j                  dz
  |j                         | j                  |j
                  dz
  |j
                         | j                  |j                  dz   |j                         | j                  |j                  dz   |j                         | j                  |j                  dz  |j                         | j                  |j                  dz  |j                         y)zfThe scale method scales around the center of the rectangle using
        keyword arguments 'x' and 'y'r   r    rZ   r(  )rP   r   Nr<  r+  s      r   +test_scale_by__larger_single_argument_kwargz8RectTypeTest.test_scale_by__larger_single_argument_kwargK  s     Aq!ZZ!Z_299-!RWW-BFF+1bhh/Aryy11bhh/Aryy1r   c                 z   t        dddd      }|j                  d      }| j                  |j                  |j                         | j                  |j                  dz   |j                         | j                  |j
                  dz   |j
                         | j                  |j                  dz
  |j                         | j                  |j                  dz
  |j                         | j                  |j                  dz
  |j                         | j                  |j                  dz
  |j                         yr;  r   r    r(        ?Nr<  r+  s      r   &test_scale_by__smaller_single_argumentz3RectTypeTest.test_scale_by__smaller_single_argumentY  s    Aq!ZZ_299-!RWW-BFF+1bhh/Aryy11bhh/Aryy1r   c                    t        dddd      }|j                  dd      }| j                  |j                  |j                         | j                  |j                  dz
  |j                         | j                  |j
                  |j                  dz  dz  z
  |j                         | j                  |j                  dz   |j                         | j                  |j
                  |j                  dz  dz  z   |j                         | j                  |j                  dz  |j                         | j                  |j                  dz  |j                         yr:  r   r=  r"   r8   r#   r7   rS   r$   r/   r0   r%   r&   r+  s      r   test_scale_by__largerz"RectTypeTest.test_scale_by__largerf  s     Aq!ZZ1299-!RWW-QSS1Wq[0"&&91bhh/QSS1Wq[0"))<1bhh/Aryy1r   c                    t        dddd      }|j                  d      }| j                  |j                  |j                         | j                  |j                  dz
  |j                         | j                  |j
                  |j                  dz  dz  z
  |j                         | j                  |j                  dz   |j                         | j                  |j
                  |j                  dz  dz  z   |j                         | j                  |j                  dz  |j                         | j                  |j                  dz  |j                         y)	zk
        The scale method scales around the center of the rectangle
        Uses 'scale_by' kwarg.
        r   r    rZ   r(  )r   r    r=  r   NrF  r+  s      r   %test_scale_by__larger_kwargs_scale_byz2RectTypeTest.test_scale_by__larger_kwargs_scale_byu  s     Aq!ZZZ(299-!RWW-QSS1Wq[0"&&91bhh/QSS1Wq[0"))<1bhh/Aryy1r   c                    t        dddd      }|j                  dd      }| j                  |j                  |j                         | j                  |j                  dz
  |j                         | j                  |j
                  |j                  dz  dz  z
  |j                         | j                  |j                  dz   |j                         | j                  |j
                  |j                  dz  dz  z   |j                         | j                  |j                  dz  |j                         | j                  |j                  dz  |j                         y)zm
        The scale method scales around the center of the rectangle
        Uses 'x' and 'y' kwargs.
        r   r    rZ   r(  rP   rR   r   NrF  r+  s      r   test_scale_by__larger_kwargsz)RectTypeTest.test_scale_by__larger_kwargs  s     Aq!ZZ!qZ!299-!RWW-QSS1Wq[0"&&91bhh/QSS1Wq[0"))<1bhh/Aryy1r   c                    t        dddd      }|j                  dd      }| j                  |j                  |j                         | j                  |j                  dz   |j                         | j                  |j
                  |j                  dz  dz  z
  |j                         | j                  |j                  dz
  |j                         | j                  |j
                  |j                  dz  dz  z   |j                         | j                  |j                  dz
  |j                         | j                  |j                  dz  |j                         y)r;  r   r    r(  rC  g      ?NrF  r+  s      r   test_scale_by__smallerz#RectTypeTest.test_scale_by__smaller  s     Aq!ZZT"299-!RWW-QSS1Wq[0"&&91bhh/QSS1Wq[0"))<1bhh/Q		2r   c                    t        dddd      }|j                  d       |j                  d       |j                  d       |j                  d       |j                  d	d
      }| j                  |j                  |j                  d	z  dz  z
  |j
                         | j                  |j                  |j                         | j                  |j                  d	z  |j                         | j                  |j                  |j                         |j                  dd
      }| j                  |j
                  |j
                         | j                  |j                  |j                         | j                  |j                  |j                         | j                  |j                  |j                         |j                  d
d	      }| j                  |j
                  |j
                         | j                  |j                  |j                  d	z  dz  z
  |j                         | j                  |j                  |j                         | j                  |j                  d	z  |j                         |j                  d
d      }| j                  |j
                  |j
                         | j                  |j                  |j                         | j                  |j                  |j                         | j                  |j                  |j                         |j                  d	      }| j                  |j                  |j                  d	z  dz  z
  |j
                         | j                  |j                  |j                  d	z  dz  z
  |j                         | j                  |j                  d	z  |j                         | j                  |j                  d	z  |j                         y)r;  r   r    rZ   r(  r   ưh㈵>ri   r   N)	r   r=  r"   r6   rQ   rP   rR   rS   r7   )r   r(   rx1rx2ry1ry2r1s          r   test_scale_by__subzeroz#RectTypeTest.test_scale_by__subzero  s   Aq!	

1	

2	

9	

7jjQQSS2X\13559cee$r355)cee$jja &&&&jjBcee$QSS2X\13559cee$r355)jjC &&&&ZZ^QSS2X\12448QSS2X\12448r244(r244(r   c                 t   t        dddd      }|j                  dd      }| j                  |j                  |j                         | j                  |j                  |j                         | j                  |j
                  |j
                         | j                  |j                  |j                         yr;  r   r    rZ   r(  r   Nr   r=  r"   rP   rR   rQ   rS   r   r(   actuals      r   test_scale_by_identityz#RectTypeTest.test_scale_by_identity  s     Aq!Aq!fhh'fhh'fhh'fhh'r   c                 t   t        dddd      }|j                  dd      }| j                  |j                  |j                         | j                  |j                  |j                         | j                  |j
                  |j
                         | j                  |j                  |j                         yr;  r   r    rZ   r(  rQ  Nr]  r^  s      r   test_scale_by_negative_identityz,RectTypeTest.test_scale_by_negative_identity  s     Aq!B#fhh'fhh'fhh'fhh'r   c                 r   t        dddd      }|j                  d      }| j                  |j                  |j                         | j                  |j                  |j                         | j                  |j
                  |j
                         | j                  |j                  |j                         yr\  r]  r^  s      r   &test_scale_by_identity_single_argumentz3RectTypeTest.test_scale_by_identity_single_argument  s     Aq!Afhh'fhh'fhh'fhh'r   c                 r   t        dddd      }|j                  d      }| j                  |j                  |j                         | j                  |j                  |j                         | j                  |j
                  |j
                         | j                  |j                  |j                         yrb  r]  r^  s      r   .test_scale_by_negative_identity_single_argmentz;RectTypeTest.test_scale_by_negative_identity_single_argment  s     Aq!Bfhh'fhh'fhh'fhh'r   c                    t        dddd      }t        |      }|j                  d       | j                  |j                  |j                         | j                  |j                  dz
  |j                         | j                  |j
                  dz
  |j
                         | j                  |j                  dz   |j                         | j                  |j                  dz   |j                         | j                  |j                  dz  |j                         | j                  |j                  dz  |j                         yr:  
r   scale_by_ipr"   r8   r#   r$   r/   r0   r%   r&   r+  s      r   test_scale_by_ip__largerz%RectTypeTest.test_scale_by_ip__larger  s    Aq!!W
q299-!RWW-BFF+1bhh/Aryy11bhh/Aryy1r   c                    t        dddd      }t        |      }|j                  d       | j                  |j                  |j                         | j                  |j                  dz   |j                         | j                  |j
                  dz   |j
                         | j                  |j                  dz
  |j                         | j                  |j                  dz
  |j                         | j                  |j                  dz  |j                         | j                  |j                  dz  |j                         yrB  ri  r+  s      r   test_scale_by_ip__smallerz&RectTypeTest.test_scale_by_ip__smaller
  s    Aq!!W
s299-!RWW-BFF+1bhh/Aryy11bhh/Aryy1r   c                     t        dddd      }|j                  d       |j                  d       |j                  d       |j                  d       y	)
r;  r   r    rZ   r(  r   rQ  rR  rS  N)r   rj  r'   s     r   test_scale_by_ip__subzeroz&RectTypeTest.test_scale_by_ip__subzero  sB    Aq!	a	b	i 	gr   c                    t        dddd      }t        |      }|j                  dd       | j                  |j                  |j                         | j                  |j                  dz
  |j                         | j                  |j
                  |j                  dz  dz  z
  |j                         | j                  |j                  dz   |j                         | j                  |j
                  |j                  dz  dz  z   |j                         | j                  |j                  dz  |j                         | j                  |j                  dz  |j                         y)r;  r   r    rZ   r(  rL  r   N)r   rj  r"   r8   r#   r7   rS   r$   r/   r0   r%   r&   r+  s      r   test_scale_by_ip__kwargsz%RectTypeTest.test_scale_by_ip__kwargs   s   Aq!!W
a  	299-!RWW-QSS1Wq[0"&&91bhh/QSS1Wq[0"))<1bhh/Aryy1r   c                    t        dddd      }| j                  t              5  |j                  d       ddd       | j                  t              5  |j                  dd	       ddd       y# 1 sw Y   ;xY w# 1 sw Y   yxY w)
zThe scale method scales around the center of the rectangle using
        keyword argument 'scale_by'. Tests for incorrect keyword argsr   r    rZ   r(  rI  Nr+   r   )r=  rR   )r   rs   rt   rj  r'   s     r   "test_scale_by_ip__kwarg_exceptionsz/RectTypeTest.test_scale_by_ip__kwarg_exceptions/  s     Aq!y) 	&MM1M%	& y) 	0MM6QM/	0 	0	& 	&	0 	0s   A1A=1A:=Bc                    t        dddd      }t        dddd      j                  |      }| j                  |j                  |j                         | j                  |j                  d       t        dddd      j                  |      }| j                  |j
                  |j
                         t        dd	d
d      j                  |      }| j                  |j                  |j                         y Nri            r   r   r   r    i     !   )r   clampr"   r/   r$   r2   r8   r   r(   cs      r   
test_clampzRectTypeTest.test_clamp:  s    RR RA$$Q'!''*#Aq!""1%AII.CR &&q)188,r   c                    t        dddd      }t        dddd      }|j                  |       | j                  |j                  |j                         | j                  |j                  d       t        dddd      }|j                  |       | j                  |j
                  |j
                         t        dd	d
d      }|j                  |       | j                  |j                  |j                         y ru  )r   clamp_ipr"   r/   r$   r2   r8   r|  s      r   test_clamp_ipzRectTypeTest.test_clamp_ipD  s    RR RA	

1!''*#Aq!	

1AII.CR 	

1188,r   c                 (   t        dddd      }| j                  t        dddd      |j                  t        dddd                   | j                  t        dddd      |j                  t        dddd                   | j                  t        dddd      |j                  t        dddd                   | j                  d|j                  dd	d
d      j                         | j                  ||j                  t        |            d       y )Nr   r   r   r    r   ri   r   rf   r   rx  rZ   z,r1 does not clip an identical rect to itself)r   r"   clipr1   r   rY  s     r   	test_clipzRectTypeTest.test_clipQ  s    !Q1aAq)27741a3C+DEaAq)27741b"3E+FGaAq)27741a3C+DERA!6!;!;<R!#Q	
r   c                     t        dd      }d}d}d}d}||f||ff}|j                  ||||      }| j                  |t               | j	                  ||       y)zjEnsures clipline handles four int parameters.

        Tests the clipline(x1, y1, x2, y2) format.
        r+   #   (   rx  rZ      rv  N)r   cliplineassertIsInstancetupleassertTupleEqualr   rG   x1y1x2y2expected_lineclipped_lines           r   test_cliplinezRectTypeTest.test_clipline[  sj    
 FH%bB8,}}RR4lE2lM:r   c                     t        dd      }d}d}t        t        t        f}||f}|D ]R  } ||      }|D ]C  }|j	                  | ||      f      }	| j                  |	t               | j                  |	|       E T y)zEnsures clipline handles a sequence of two sequences.

        Tests the clipline((x1, y1), (x2, y2)) format.
        Tests the sequences as different types.
        r+   r  rx  rZ   r  rv  Nr   listr  r   r  r  r  
r   rG   pt1pt2INNER_SEQUENCESr  
inner_seq1endpt1
inner_seq2r  s
             r   test_clipline__two_sequencesz)RectTypeTest.test_clipline__two_sequencesl  s     FH%0c
) 	CJ_F- C
#}}fjo-FG%%lE:%%lMB	C	Cr   c                     t        dd      }d}d}t        t        t        f}||f}|D ]R  } ||      }|D ]C  }|j	                  | ||            }	| j                  |	t               | j                  |	|       E T y)zEnsures clipline handles a sequence of two sequences using kwargs.

        Tests the clipline((x1, y1), (x2, y2)) format.
        Tests the sequences as different types.
        r+   r  r  r  first_coordinatesecond_coordinateNr  r  s
             r   "test_clipline__two_sequences_kwargz/RectTypeTest.test_clipline__two_sequences_kwarg  s     FH%0c
) 		CJ_F- C
#}}%+z#  -   %%lE:%%lMBC		Cr   c                     t        dd      }d}|d   |d   f|d   |d   ff}t        t        fD ]A  }|j                   ||            }| j	                  |t               | j                  ||       C y)	zEnsures clipline handles a sequence of four ints.

        Tests the clipline((x1, y1, x2, y2)) format.
        Tests the sequence as different types.
        r+   r  rx  rZ   r  rv  r   r   r   r   Nr   r  r  r  r  r  r   rG   liner  	outer_seqr  s         r   $test_clipline__sequence_of_four_intsz1RectTypeTest.test_clipline__sequence_of_four_ints  s~     FH%q'47+d1gtAw-?@ 	?I==49L!!,6!!,>		?r   c                     t        dd      }d}|d   |d   f|d   |d   ff}t        t        fD ]B  }|j                   ||            }| j	                  |t               | j                  ||       D y	)
zEnsures clipline handles a sequence of four ints using kwargs.

        Tests the clipline((x1, y1, x2, y2)) format.
        Tests the sequence as different types.
        r+   r  r  r   r   r   r   rect_argNr  r  s         r   +test_clipline__sequence_of_four_ints_kwargsz8RectTypeTest.test_clipline__sequence_of_four_ints_kwargs  s     FH%q'47+d1gtAw-?@ 	?I==)D/=BL!!,6!!,>		?r   c           	      .   t        dd      }d}d}t        t        t        f}||f}|D ]k  } ||      }|D ]\  } ||      }	t        t        fD ]C  }
|j	                   |
||	f            }| j                  |t               | j                  ||       E ^ m y)zEnsures clipline handles a sequence of two sequences.

        Tests the clipline(((x1, y1), (x2, y2))) format.
        Tests the sequences as different types.
        r+   r  r  r  Nr  r   rG   r  r  r  r  r  r  r  endpt2r  r  s               r   (test_clipline__sequence_of_two_sequencesz5RectTypeTest.test_clipline__sequence_of_two_sequences  s     FH%0c
) 
	GJ_F- G
#C"& GI#'==FF;K1L#ML)),>)),F	GG
	Gr   c           	      0   t        dd      }d}d}t        t        t        f}||f}|D ]l  } ||      }|D ]]  } ||      }	t        t        fD ]D  }
|j	                   |
||	f            }| j                  |t               | j                  ||       F _ n y)zEnsures clipline handles a sequence of two sequences using kwargs.

        Tests the clipline(((x1, y1), (x2, y2))) format.
        Tests the sequences as different types.
        r+   r  r  r  r  Nr  r  s               r   /test_clipline__sequence_of_two_sequences_kwargsz<RectTypeTest.test_clipline__sequence_of_two_sequences_kwargs  s     FH%0c
) 
	GJ_F- G
#C"& GI#'==Ivv>N4O=#PL)),>)),F	GG
	Gr   c                 L   t        dd      }d}d}d}d}t        j                  |      t        j                  |      ft        j                  |      t        j                  |      ff}|j                  ||||      }| j	                  |t
               | j                  ||       y)z*Ensures clipline handles float parameters.r+   r  皙@皙@'@fffff3@Nr   mathfloorr  r  r  r  r  s           r   test_clipline__floatsz"RectTypeTest.test_clipline__floats  s    FH% ZZ^TZZ^,ZZ^TZZ^,

 }}RR4lE2lM:r   c                 N   t        dd      }d}d}d}d}t        j                  |      t        j                  |      ft        j                  |      t        j                  |      ff}|j                  ||||      }| j	                  |t
               | j                  ||       y)	zlEnsures clipline handles four float parameters.

        Tests the clipline(x1, y1, x2, y2) format.
        r+   r  r  r  r  r  )r  r  x3x4Nr  r  s           r   test_clipline__floats_kwargsz)RectTypeTest.test_clipline__floats_kwargs  s    
 FH% ZZ^TZZ^,ZZ^TZZ^,

 }}rbR}@lE2lM:r   c                    t        dddd      }| j                  t              5  |j                  d       ddd       | j                  t              5  |j                  dd	
       ddd       | j                  t              5  |j                  ddd       ddd       | j                  t              5  |j                  d       ddd       | j                  t              5  |j                  dd       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# 1 sw Y   yxY w)z3Ensure clipline handles incorrect keyword argumentsr   r    rZ   r(  r   r  N)r   r   rx  r    r+   r  )r   r   r   r   r   )r  r  r  )r   r   rx  r  )r  r  r   rs   rt   r  r'   s     r   test_clipline__kwarg_exceptionsz,RectTypeTest.test_clipline__kwarg_exceptions  s)   Aq!y) 	JJ!J	 y) 	PJJJO	P y) 	PJJ&QJO	P y) 	+JJ	J*	+ y) 	HJJJG	H 	H	 		P 	P	P 	P	+ 	+	H 	Hs;   DDD7D('D4DDD%(D14D=c                 T   t        dd      }|j                  dd      }|j                  |j                  f|j                  |j                  f|j                  |j
                  f|j
                  |j                  ff}d}|D ]%  }|j                  |      }| j                  ||       ' y)z;Ensures lines that do not overlap the rect are not clipped.ri         r   r   r   N)r   r*  r4   r2   r3   r5   r  r  )r   rG   big_rectlinesr  r  r  s          r   test_clipline__no_overlapz&RectTypeTest.test_clipline__no_overlap(  s    Hh'<<1%  ("2"23x001 4 45!!8#6#67	
   	?D==.L!!,>	?r   c                    t        dd      }|j                  dd      }|j                  |j                  f|j                  |j                  d   dz
  |j                  d   ff|j                  |j
                  f|j                  |j
                  d   |j
                  d   dz
  ff|j                  |j                  f|j                  |j                  d   dz
  |j                  d   dz
  ff|j                  d   dz
  |j                  d   f|j                  d   |j                  d   dz
  ff|j                  d   dz
  |j                  d   f|j                  d   |j                  d   dz
  ffi}|j                         D ]]  \  }}|j                  |      }| j                  ||       |d   |d   f}|j                  |d   |d   f      }| j                  ||       _ y)zvEnsures lines that overlap the rect are clipped.

        Testing lines with both endpoints outside the rect.
        rf   r   r   r   r   r   N)r   r*  r;   r<   r9   r:   r2   r5   r3   r4   itemsr  r  r   rG   r  	line_dictr  r  r  s          r   %test_clipline__both_endpoints_outsidez2RectTypeTest.test_clipline__both_endpoints_outside;  s   
 FH%<<1% x001q!A%t}}Q'784 __h001"DNN1$5$9:4
 x334!!!$q($*:*:1*=*AB7 ""1%)8+<+<Q+?@$$Q')<)<Q)?!)CD q!A%t}}Q'78#T__Q%7!%;<'
	2 $-??#4 
	?D-==.L!!,> +1-}Q/?@M==$q'47);<L!!,>
	?r   c                    t        dd      }|j                  dd      }|j                  |j                  f|j                  |j
                  f|j                  |j                  f|j                  |j                  ff}|D ]\  }|}|j                  |      }| j                  ||       |d   |d   f}|j                  |d   |d   f      }| j                  ||       ^ y)zuEnsures lines that overlap the rect are clipped.

        Testing lines with both endpoints inside the rect.
        )rT  r  r   r   N)r   r*  r;   r<   r9   r:   r2   r5   r3   r4   r  r  )r   rG   
small_rectr  r  r  r  s          r   $test_clipline__both_endpoints_insidez1RectTypeTest.test_clipline__both_endpoints_insidej  s    
 Ix(\\"b)
 !4!45
 4 45!7!78  *"7"78
  	?D M==.L!!,> +1-}Q/?@M==$q'47);<L!!,>	?r   c                    t        dd      }|j                  dd      }|j                  |j                  f|j                  |j                  f|j                  |j                  f|j                  |j                  f|j
                  |j                  f|j
                  d   dz
  |j
                  d   f|j                  f|j                  |j                  f|j                  d   |j                  d   dz
  f|j                  f|j                  |j                  f|j                  |j                  f|j                  |j                  f|j                  d   dz
  |j                  d   f|j                  f|j                  |j                  f|j                  d   dz
  |j                  d   dz
  f|j                  f|j                  d   |j                  d   dz
  f|j                  f|j                  d   |j                  d   dz
  f|j                  fi}|j                         D ]]  \  }}|j                  |      }| j                  ||       |d   |d   f}|j                  |d   |d   f      }| j                  ||       _ y)zEnsures lines that overlap the rect are clipped.

        Testing lines with one endpoint outside the rect and the other is
        inside the rect.
        rf   )   r  r   r   r   N)r   r*  r;   r8   r9   r<   r:   r2   r3   r5   r4   r  r  r  r  s          r   +test_clipline__endpoints_inside_and_outsidez8RectTypeTest.test_clipline__endpoints_inside_and_outside  sc    FH%<<1% t{{+dllDKK-H__dkk*T[[$++,F,q!A%t}}Q'78/ -"DNN1$5$9:0
 t{{+dllDKK-H,q!A%t}}Q'78/ !!4;;/!!!$q($*:*:1*=*AB2 !!!$h&9&9!&<q&@A4;;O#T__Q%7!%;<R/
	: $-??#4 
	?D-==.L!!,> +1-}Q/?@M==$q'47);<L!!,>
	?r   c                 p   t        dd      }|j                  |j                  f|j                  d   |j                  d   dz
  f|j                  f|j                  |j                  f|j                  |j                  d   dz
  |j                  d   ff|j                  |j                  fd|j                  |j                  fdi}|j                         D ]_  \  }}|j                  |      }| j                  ||       |r
|d   |d   f}|j                  |d   |d   f      }| j                  ||       a y)zCEnsures clipline properly clips line that are along the rect edges.r  r  r   r   r   N)r   r4   r2   r3   r5   r  r  r  )r   rG   	edge_dictedger  r  s         r   test_clipline__edgesz!RectTypeTest.test_clipline__edges  s8   Hh'
 __dll+#T__Q%7!%;<.
 \\4==)q!A%t}}Q'78,
 ]]D,,-rt/
	" $-??#4 	?D-==.L!!,> !.q!1=3C D==$q'47);<L!!,>	?r   c                     t        dd      fdt        j                  j                        D        }|D ]+  }||f}j	                  ||f      }| j                  ||       - y)zsEnsures clipline handles lines with both endpoints the same.

        Testing lines that overlap the rect.
        r  r  c              3   p   K   | ]-  }t        j                  j                        D ]  }||f 
 / y wr
   )ranger$   r0   ).0rP   rR   rG   s      r   	<genexpr>zKRectTypeTest.test_clipline__equal_endpoints_with_overlap.<locals>.<genexpr>  sA      
488T[[1
  F

s   36N)r   r  r#   r/   r  r  )r   ptsptr  r  rG   s        @r   +test_clipline__equal_endpoints_with_overlapz8RectTypeTest.test_clipline__equal_endpoints_with_overlap  sk    
 Hh'
499djj1
  	?BHM=="b2L!!,>	?r   c                     d}t        dd      }t        j                  |j                  dd            D ]'  }|j	                  ||f      }| j                  ||       ) y)zzEnsures clipline handles lines with both endpoints the same.

        Testing lines that do not overlap the rect.
        r   r  r  r   N)r   r   rect_perimeter_ptsr*  r  r  )r   r  rG   r  r  s        r   )test_clipline__equal_endpoints_no_overlapz6RectTypeTest.test_clipline__equal_endpoints_no_overlap  s^    
 Hh' //Q0BC 	?B=="b2L!!,>	?r   c                     d}dD ]F  }t        d|      }|j                  |j                  |j                        }| j                  ||       H y)z4Ensures clipline handles zero sized rects correctly.r   ))r   r  )r  r   rf   r  N)r   r  r2   r  )r   r  r1   rG   r  s        r   test_clipline__zero_size_rectz*RectTypeTest.test_clipline__zero_size_rect  sJ    . 	?D$'D==t||DL!!,>	?r   c                 n   d}dD ]-  }t        d|      }|j                         }|j                          |j                  dd      }|j                  |j
                  f|j                  |j
                  d   dz
  |j
                  d   ff|j                  |j                  f|j                  |j                  d   |j                  d   dz
  ff|j                  |j                  f|j                  |j                  f|j                  |j                  f|j                  |j                  f|j
                  |j                  f|j
                  d   dz
  |j
                  d   f|j                  f|j                  |j                  f|j                  d   |j                  d   dz
  f|j                  fi}|j                         D ]o  \  }}|j                  |      }| j                  ||       | j                  ||       |d   |d   f}|j                  |d   |d   f      }| j                  ||       q 0 y)z8Ensures clipline handles negative sized rects correctly.r   ))r   )r  )r  r  r  r   r   r   N)r   copyrT   r*  r;   r<   r9   r:   r8   r  r  assertNotEqualr  )	r   r  r1   rG   	norm_rectr  r  r  r  s	            r   !test_clipline__negative_size_rectz.RectTypeTest.test_clipline__negative_size_rect  sW   6 1	CD$'D		I! ((A.H !!8#4#45%%''*Q.	0B0B10EF8 ("4"45$$((+Y-@-@-Ca-GH8 !!9#3#34%%$$7 )"2"23$$$$6 ""I$4$45''*Q.	0B0B10EF$$8 ##Y%5%56((+Y-@-@-Ca-GH$$9+I6 (1'8 C#m#}}T2 ##D)4%%lMB "/q!1=3C D#}}d1gtAw-?@%%lMBCK1	Cr   c                    t        dd      }d}|D ]^  }| j                  t              5  |j                  |      }ddd       | j                  t              5   |j                  | }ddd       ` y# 1 sw Y   9xY w# 1 sw Y   wxY w)z1Ensures clipline handles invalid lines correctly.rf   r  )r   rq   r+   rr   )r   r   r   r    rx  )r+   )r+   )r   )r+   r   ))r   r   rx  r,   )r+   )r   r    rx  )r+   r,   r  Nr  )r   rG   invalid_linesr  r  s        r   test_clipline__invalid_linez(RectTypeTest.test_clipline__invalid_lineE  s    FH%
 " 	4D""9- 3#}}T23 ""9- 4,t}}d34 4		43 34 4s   A3A?3A<	?B	c                     t        dddd      }d}d}|j                  ||      }t        |j                  |z   |j                  |z   |j                  |j
                        }| j                  ||       y Nr   r   r   r    ri   r   )r   mover#   r$   r%   r&   r"   )r   r(   move_xmove_yr,  expected_r2s         r   	test_movezRectTypeTest.test_move]  sd    Aq!VVFF#166F?AEEFNAGGQXXNb)r   c                     t        dddd      }t        |      }d}d}|j                  ||       t        |j                  |z   |j                  |z   |j                  |j
                        }| j                  ||       y r  )r   move_ipr#   r$   r%   r&   r"   )r   r(   r,  r   r  r  s         r   test_move_ipzRectTypeTest.test_move_ipe  sk    Aq!!W


66"166F?AEEFNAGGQXXNb)r   z=fails on pypy (but only for: bottom, right, centerx, centery)c           
         d}d}d}g |d|t               f|d|t               f|d|dz   t               f|d|dz   t               f|d	|d
z   t               f|d|t               f|d|t               f|d|dz
  t               f|d|dz
  t               f|d|d
z
  t               f|d|dz   t               f|d|dz   t               f|d|dz
  t               f|d|dz
  t               f|d|t               f|d|t               f|d|dz   t               f|d|dz   t               f|d	|d
z   t               f|d|t               f|d|t               f|d|t               f|d|dz
  t               f|d|d
z
  t               f|d|dz   t               f|d|dz   t               f|d|dz
  t               f|d|dz
  t               f|d|t               f|d|t               f|d|t               f|d|dz   t               f|d	|dz   t               f|d|t               f|d|t               f|d|dz
  t               f|d|dz
  t               f|d|d
z
  t               f|d|dz   t               f|d|dz   t               f|d|dz
  t               f|d|dz
  t               f}g d}g d}|D ]  }|\  }}	}
}||	z   }|D ]x  }| j                  |d|       5  t        t               t               t               t                     }t        |||       | j	                  |
t        ||             d d d        z |D ]  }| j                  |d| d      5  t        t               t               t               t                     }t        ||||f       | j	                  |
|ft        ||             d d d        | j                  |d| d      5  t        t               t               t               t                     }t        ||||f       | j	                  ||
ft        ||             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)Nr   |   iPg?g?rC  r   皙?g      ?r   ggٿg      g333333gr    rQ  r0  rP   rR   rQ   rS   r%   r&   r$   r#   r0   r/   r6   r7   
r2   r3   r4   r5   r9   r;   r:   r<   r1   r8   r.rowname[0][1])r   subTestr   setattrr"   getattr)r   zeroposneg	data_rowssingle_value_attribute_namestuple_value_attribute_namesr  initialincexpectedother	new_valueattribute_namer_  s                  r   test_set_float_valuesz"RectTypeTest.test_set_float_valuesn  s    +
3km,+
3km,+
 3q+-0+
 3q+-0	+

 3q+-0+
 4{}-+
 4{}-+
 4;=1+
 4;=1+
 4;=1+
 1dQh.+
 1dQh.+
 2tax/+
 2tax/+
 #sKM*+
  #sKM*!+
" #sQw.#+
$ #sQw.%+
& #sQw.'+
( $[]+)+
* $[]+++
, $[]+-+
. $a//+
0 $a/1+
2 !S1Wkm,3+
4 !S1Wkm,5+
6 "cAg{}-7+
8 "cAg{}-9+
: #sKM*;+
< #sKM*=+
> #sKM*?+
@ #sQw.A+
B #sQw.C+
D $[]+E+
F $[]+G+
H $a/I+
J $a/K+
L $a/M+
N !S1Wkm,O+
P !S1Wkm,Q+
R "cAg{}-S+
T "cAg{}-U+
	Z(
$'
#  	YC,/)GS(E#I"> P\\c"^4D0E\F P!#{}km[]F FNI>$$Xwv~/NOP PP #> Y\\c"^4DC0H\I Y!#{}km[]F FNY4FG$$h%68WXY \\c"^4DC0H\I Y!#{}km[]F FNUI4FG$$eX%68WXY YY	YP PY YY Ys'   AQAQAQQQQ$c                 $   d}t         dz   t        ft         dz   t        ft         d ft         dz
  d ft         dz
  d ft         dz
  d ft         dz
  d ft         dz
  d ft         dz
  d ft        dz
  t        ft        dz
  t        ft        d ft        dz   d ft        dz   d ft        dz   d ft        d	z   d ft        dz   d ft        dz   d fd
ddg}g d}g d}|D ]  }|D ]}  }|\  }}| j                  |d|       5  t	        dddd      }	|r| j                  t        t        |	||       n)t        |	||       | j                  |t        |	|             d d d         t               }
|D ]  }|\  }}| j                  |d| d      5  t	        dddd      }	|r | j                  t        t        |	|||
f       n-t        |	|||
f       | j                  ||
ft        |	|             d d d        | j                  |d| d      5  t	        dddd      }	|r | j                  t        t        |	||
|f       n-t        |	||
|f       | j                  |
|ft        |	|             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)Nr   r   rS  r   ri   ?   @   A   >   )r   N)i N)i`yNr
  r  r  r  r  r  )
r   rt   r   r  r   rs   r  r"   r  r   )r   rI   r  single_attribute_namesr  r  r   rv   r  r_  r  s              r   -test_set_out_of_range_number_raises_exceptionz:RectTypeTest.test_set_out_of_range_number_raises_exception  s    \9%+t\4 \4 ]D!]D!]D!]D!\9%+t\4 \4 ]D!]D!]D!]D!+
	0"
'
#  0	C"8 Q"%x\\c"^4D0E\F Q!!Q1-F))%w
  >((0OPQ QQ  ME"= "%x\\c"^4DC0H\I !!Q1-F))%wPU
  G(("ENGFN,K \\c"^4DC0H\I !!Q1-F))%wPU
  G(("ENGFN,K ##0	Q Q   s'   4AI,AI9?AJ,I69JJc                 (   t        dddd      }|j                  dddd       | j                  d|j                         | j                  d|j                         | j                  d|j
                         | j                  d|j                         y)z)Test update with 4 int values(x, y, w, h)r   r   r   r   r    Nr   updater"   r#   r$   r%   r&   r   rG   s     r   test_update_XYWidthHeightz&RectTypeTest.test_update_XYWidthHeightH  st    Aq!QAq!QDII&DHH%DJJ'DKK(r   c                 $   t        dddd      }|j                  dd       | j                  d|j                         | j                  d|j                         | j                  d|j
                         | j                  d|j                         y)	z)Test update with 2 tuples((x, y), (w, h))r   r   r+   r,   r   r   r    Nr*  r,  s     r   test_update__TopLeftSizez%RectTypeTest.test_update__TopLeftSizeR  sp    Aq!QFF#DII&DHH%DJJ'DKK(r   c                 *   t        dddd      }g d}|j                  |       | j                  d|j                         | j                  d|j                         | j                  d|j
                         | j                  d|j                         y)zTest update with listr   r   r   r   r   r    r   r   r    Nr*  r   rG   rect2s      r   test_update__ListzRectTypeTest.test_update__List\  ss    Aq!QEDII&DHH%DJJ'DKK(r   c                 >   t        dddd      }t        dddd      }|j                  |       | j                  d|j                         | j                  d|j                         | j                  d|j
                         | j                  d|j                         y)z"Test update with other rect objectr   r   r   r   r    Nr*  r2  s      r   test_update__RectObjectz$RectTypeTest.test_update__RectObjectg  s~    Aq!QQ1a EDII&DHH%DJJ'DKK(r   c                     t        dddd      }t        dddd      }| j                  t        dddd      |j                  |             y Nr   r   r  r    rx  r   r"   unionr   rY  r,  s      r   
test_unionzRectTypeTest.test_unionr  sE    !Q1"b!Qb"a+RXXb\:r   c                 t    t        dddd      }| j                  ||j                  t        |                   y r   r9  r  s     r   test_union__with_identical_Rectz,RectTypeTest.test_union__with_identical_Rectw  s/    !Q1RXXd2h/0r   c                     t        dddd      }t        dddd      }|j                  |       | j                  t        dddd      |       y r8  )r   union_ipr"   r;  s      r   test_union_ipzRectTypeTest.test_union_ip{  sH    !Q1"b!Q
Bb"a+R0r   c                     t        dddd      }t        dddd      }t        dddd      }|j                  ||g      }| j                  t        dddd      |       y Nr   r   r  r   rx  r   unionallr"   r   rY  r,  r3r4s        r   test_unionallzRectTypeTest.test_unionall  s_    !Q1"b!Q!Q1[["b"b"a+R0r   c                     g d}g d}ddg}|||fD ]=  }| j                  t              5  t        dddd      j                  |       ddd       ? y# 1 sw Y   JxY w)z;Ensures unionall correctly handles invalid rect parameters.)r   g333333?r   gffffff
@)abr}  Nr   r   )rs   rt   r   rE  )r   numbersstrsnonesinvalid_rectss        r   "test_unionall__invalid_rect_formatz/RectTypeTest.test_unionall__invalid_rect_format  sl    "t%tU3 	9M""9- 9Q1a ))-89 9	99 9s   AA	c                     t        dddd      }t        dddd      }t        dddd      }|j                  ||g      }| j                  t        dddd      |       y )Nr   r   r  r   rG   rx  rD  rF  s        r   test_unionall__kwargsz"RectTypeTest.test_unionall__kwargs  sa    !Q1"b!Q!Q1[[r2h['b"a+R0r   c                     t        dddd      }t        dddd      }t        dddd      }|j                  ||g       | j                  t        dddd      |       | j                  |j                  g       d u        y rC  r   unionall_ipr"   r  r   rY  r,  rG  s       r   test_unionall_ipzRectTypeTest.test_unionall_ip  sy    !Q1"b!Q!Q1
Bx b"a+R0 	r*d23r   c                     t        dddd      }t        dddd      }t        dddd      }|j                  ||g       | j                  t        dddd      |       | j                  |j                  g       d u        y )Nr   r   r  r   rectsrx  rV  rX  s       r   test_unionall_ip__kwargsz%RectTypeTest.test_unionall_ip__kwargs  s{    !Q1"b!Q!Q1
b"X&b"a+R0 	r*d23r   c                 2   t        dddd      }| j                  |j                  t        dddd            d       | j                  |j                  t        dddd            d       | j                  |j                  t        |j                  |j
                  dd            d       | j                  |j                  t        |j                  dz   |j                  dz   |j                  dz
  |j                  dz
              d	       | j                  |j                  t        |j                  dz
  |j                  dz
  |j                  dz   |j                  dz               d
       | j                  |j                  t        |            d       | j                  |j                  t        |j                  |j
                  dd            d       | j                  |j                  t        |j                  |j
                  dd            d       y )Nr   r   r   r    r   z)r1 does not collide with Rect(0, 0, 2, 3)z!r1 collides with Rect(0, 0, 1, 2)z0r1 collides with Rect(r1.right, r1.bottom, 2, 2)zSr1 does not collide with Rect(r1.left + 1, r1.top + 1, r1.width - 2, r1.height - 2)zSr1 does not collide with Rect(r1.left - 1, r1.top - 1, r1.width + 2, r1.height + 2)z*r1 does not collide with an identical rectz0r1 collides with Rect(r1.right, r1.bottom, 0, 0)z0r1 collides with Rect(r1.right, r1.bottom, 1, 1))
r   r  colliderectr!  r/   r0   r#   r$   r%   r&   r  s     r   test_colliderectzRectTypeTest.test_colliderect  s   !Q1NN41a+,7	
 	NN41a+,.Q	
 	NN4"))Q:;>	
 	NN4!RVVaZAryyST}UV-	

 	NN4!RVVaZAryyST}UV-	

 	NN48$&R	
 	NN4"))Q:;>	
 	NN4"))Q:;>	
r   c                    t        dddd      }t        dddd      }d	}t        dddd      } G d
 dt               } G d dt               } |dddd      } |dddd      }| j                  ||       | j                  ||       |||||g}	|	j                  |       |	j                  |       |	j                  |       |	j                  |       | j	                  t
        |	j                  |       y)z%check to see how the rect uses __eq__r   r   r   r    ri   r   r   r  )ri   r   r   r  c                       e Zd Zd Zd Zy)$RectTypeTest.testEquals.<locals>.fooc                 0    t        |       t        |      k(  S r
   idr   r  s     r   __eq__z+RectTypeTest.testEquals.<locals>.foo.__eq__      $x2e9,,r   c                 0    t        |       t        |      k7  S r
   re  rg  s     r   __ne__z+RectTypeTest.testEquals.<locals>.foo.__ne__  ri  r   N)__name__
__module____qualname__rh  rk  r   r   r   foorc    s    --r   ro  c                       e Zd Zy)%RectTypeTest.testEquals.<locals>.foo2N)rl  rm  rn  r   r   r   foo2rq    s    r   rr  N)r   r  r"   removers   
ValueError)
r   rY  r,  rG  rH  ro  rr  r5r6	rect_lists
             r   
testEqualszRectTypeTest.testEquals  s    !Q1"b"b!"b"b!	-$ 	-	4 	 RR "b"b!B# 	R RR(	 	*i&6&6;r   c                    t        dddd      }d|j                         f}dt        dddd      f}dt        dddd      f}dt        d	d	dd      f}t        ||||f      }||f}|j                         D 	ci c]  \  }}	t	        |	      | }
}}	t	        d
 |D              }dD ]1  }|r|}|}n|}|
}|j                  ||      }| j                  ||       3 yc c}	}w )z'Ensures collidedict detects collisions.r   ri   	collide 1	collide 2rx  no collide 1<   no collide 2F   c              3   <   K   | ]  \  }}t        |      |f  y wr
   r  r  kvs      r   r  z0RectTypeTest.test_collidedict.<locals>.<genexpr>       !PDAq58Q-!P   TFNr   r  dictr  r  collidedictassertInr   rG   collide_item1collide_item2no_collide_item1no_collide_item2rect_valuesvalue_collide_itemsr  r  	rect_keyskey_collide_items
use_valuesexpected_itemsdcollide_items                   r   test_collidedictzRectTypeTest.test_collidedict  s   Aq"b!$diik2$d1aR&89*DRR,@A*DRR,@A M+;=MN
  -m< .9->->-@ATQU1Xq[A	A!!P<O!PP' 	8J!4!2++Az:L MM,7	8 Bs   7Cc                 `   t        dddd      }dt        dddd      f}dt        dddd      f}dt        dddd      f}t        |||f      }|j                         D ci c]  \  }}t        |      | }}}d	D ]+  }	|	r|n|}
|j	                  |
|	      }| j                  |       - y
c c}}w )z4Ensures collidedict returns None when no collisions.r   ri   r|  rA   r~  r}  no collide 3r  r  Nr   r  r  r  r  assertIsNoner   rG   r  r  no_collide_item3r  r  r  r  r  r  r  s               r   test_collidedict__no_collisionz+RectTypeTest.test_collidedict__no_collision  s    Aq"b!*DRR,@A*DRR,@A*DRR,@A ,.>@PQR .9->->-@ATQU1Xq[A	A' 	,J)yA++Az:Ll+	, B    B*c           	      6   t        dddd      }t        dddd      }d|f}dt        dddd      f}dt        dddd      f}d	t        d
d
dd      f}t        |||f      }|j                         D 	ci c]  \  }}	t        |	      | }
}}	dD ]  }t	        ||t        ||             dD ]f  }|r|}t        |      }nt        |d         |d   f}t        |
      }|j                  |f       |j                  ||      }| j                  ||       h  yc c}	}w )z@Ensures collidedict works correctly for rects that barely touch.r   ri   r   rz  r|  rA   r~  r}  r  r  r2   r3   r5   r4   r  N)	r   r  r  r  r  r  r+  r  r  )r   rG   collide_rectr  r  r  r  no_collide_rect_valuesr  r  no_collide_rect_keysattrr  expected_itemr  r  s                   r   !test_collidedict__barely_touchingz.RectTypeTest.test_collidedict__barely_touching+  sY   Aq"b!Aq!Q'$l3*DRR,@A*DRR,@A*DRR,@A "&/1AB"

 9O8T8T8VW1a!WW I 	CDL$d(;<+ C
$1M34A%*=+;%<mA>N$OM12A-)*#//:>%%lMBC	C  Xs   2Dc           	         t        dddd      }t        dddd      }t        dddd      }t        dddd      }t        dddd      }d|j                         f}d|j                         f}d|j                         f}d|j                         f}	d|j                         f}
d	t        ddd
d
      f}dt        dddd      f}t        ||||	|
||f      }|j                         D ci c]  \  }}t	        |      | }}}dD ]7  }|r|n|}|||||fD ]%  }|j                  ||      }| j                  |       ' 9 yc c}}w )zEnsures collidedict works correctly with zero sized rects.

        There should be no collisions with zero sized rects.
        r   r   rQ  r|  r~  r  no collide 4no collide 5no collide 6ri   no collide 7r   r  N)r   r  r  r  r  r  r  )r   
zero_rect1
zero_rect2
zero_rect3
zero_rect4
zero_rect5r  r  r  no_collide_item4no_collide_item5no_collide_item6no_collide_item7r  r  r  r  r  r  	zero_rectr  s                        r   "test_collidedict__zero_sized_rectsz/RectTypeTest.test_collidedict__zero_sized_rectsP  s   
 !Q1%
!Q1%
!Q1%
!QA&
!Q2&
*JOO,=>*JOO,=>*JOO,=>*JOO,=>*JOO,=>*DAr2,>?*DAq!,<=        

 .9->->-@ATQU1Xq[A	A' 	0J)yA  	0	  )44Q
C!!,/	0	0 Bs   &D<c                 `   t        dddd      }dt        dddd      f}dt        dddd      f}dt        dddd      f}t        |||f      }|j                         D ci c]  \  }}t        |      | }}}dD ]+  }	|	r|n|}
|j	                  |
|	      }| j                  |       - yc c}}w )	zEnsures collidedict works correctly with zero sized rects as args.

        There should be no collisions with zero sized rects.
        r   ri   r|  r   r~  r  r  Nr  r  s               r   *test_collidedict__zero_sized_rects_as_argsz7RectTypeTest.test_collidedict__zero_sized_rects_as_args  s    
 Aq"b!*DAq!,<=*DAq!,<=*DAq!,<= ,.>@PQR .9->->-@ATQU1Xq[A	A' 	,J)yA++Az:Ll+	, Br  c                    t        dddd      }d|j                         f}dt        dddd      f}dt        dddd      f}t        |||f      }||f}|j                         D ci c]  \  }}t	        |      | }	}}t	        d |D              }
d	D ]1  }|r|}|}n|
}|	}|j                  ||      }| j                  ||       3 y
c c}}w )z>Ensures collidedict works correctly with negative sized rects.r   rQ  rz  r{  r   ri   r|  c              3   <   K   | ]  \  }}t        |      |f  y wr
   r  r  s      r   r  zFRectTypeTest.test_collidedict__negative_sized_rects.<locals>.<genexpr>  r  r  r  Nr  )r   neg_rectr  r  r  r  r  r  r  r  r  r  collide_itemsr  r  s                  r   &test_collidedict__negative_sized_rectsz3RectTypeTest.test_collidedict__negative_sized_rects  s    1b"%$hmmo6$d1aR&89*DAr2,>? M=:JKL,m< .9->->-@ATQU1Xq[A	A!!P<O!PP' 	7J 3 1#//:>L MM,6	7 Bs   &Cc                    t        dddd      }dt        dddd      f}dt        dddd      f}dt        dddd      f}t        |||f      }|j                         D ci c]  \  }}t        |      | }}}dD ]B  }	|	r|}
|}nt        |d         |d   f}
|}|j	                  ||	      }| j                  ||
       D y	c c}}w )
zBEnsures collidedict works correctly with negative sized rect args.r   ri   rz  r   rQ  r|  r~  r  N)r   r  r  r  r  r  )r   rG   r  r  r  r  r  r  r  r  r  r  r  s                r   .test_collidedict__negative_sized_rects_as_argsz;RectTypeTest.test_collidedict__negative_sized_rects_as_args  s    Aq"b!$d1aR&89*DAr1,=>*DAq",=> M+;=MNO .9->->-@ATQU1Xq[A	A' 
	?J -!&}Q'7!8-:J K++Az:L!!,>
	? Bs    Cc                     t        dddd      }d|j                         f}t        |d         |d   f}dD ]8  }|r|n|}| j                  t              5  |j                  ||      }ddd       : y# 1 sw Y   ExY w)z>Ensures collidedict correctly handles invalid dict parameters.r   ri   collider   r  N)r   r  r  rs   rt   r  r   rG   invalid_value_dictinvalid_key_dictr  r  r  s          r   %test_collidedict__invalid_dict_formatz2RectTypeTest.test_collidedict__invalid_dict_format  s    Aq"b!'5 !3A!679KA9NN' 	?J&0"6FA""9- ?#//:>? ?	?? ?   A22A;	c                     t        dddd      }t        |      di}| j                  t              5  |j	                  |d      }ddd       y# 1 sw Y   yxY w)z@Ensures collidedict correctly handles dicts with invalid values.r   ri   r  r   N)r   r  rs   rt   r  )r   rG   r  r  s       r   +test_collidedict__invalid_dict_value_formatz8RectTypeTest.test_collidedict__invalid_dict_value_format  sU    Aq"b!4[),	y) 	:++Iq9L	: 	: 	:   AAc                     t        dddd      }d|j                         i}| j                  t              5  |j	                  |      }ddd       y# 1 sw Y   yxY w)z>Ensures collidedict correctly handles dicts with invalid keys.r   ri   r  N)r   r  rs   rt   r  )r   rG   r  r  s       r   )test_collidedict__invalid_dict_key_formatz6RectTypeTest.test_collidedict__invalid_dict_key_format  sU    Aq"b! $))+.y) 	9++K8L	9 	9 	9   AAc                     t        dddd      }i }d|dfD ]2  }| j                  t              5  |j                  ||      }ddd       4 y# 1 sw Y   ?xY w)zDEnsures collidedict correctly handles invalid use_values parameters.r   r   Nr	  )r   rs   rt   r  )r   rG   r  invalid_paramr  s        r   +test_collidedict__invalid_use_values_formatz8RectTypeTest.test_collidedict__invalid_use_values_format  sm    Aq!Q"As^ 	BM""9- B#//=AB B	BB B   AA	c                    t        dddd      }d|j                         f}dt        dddd      f}dt        dddd      f}dt        d	d	dd      f}t        ||||f      }||f}|j                         D 	ci c]  \  }}	t	        |	      | }
}}	t	        d
 |D              }dD ]2  }|r|}|}n|}|
}|j                  ||      }| j                  ||       4 yc c}	}w )z=Ensures collidedict detects collisions via keyword arguments.r   ri   rz  r{  rx  r|  r}  r~  r  c              3   <   K   | ]  \  }}t        |      |f  y wr
   r  r  s      r   r  z8RectTypeTest.test_collidedict__kwargs.<locals>.<genexpr>	  r  r  r  	rect_dictvaluesNr  r  s                   r   test_collidedict__kwargsz%RectTypeTest.test_collidedict__kwargs  s   Aq"b!$diik2$d1aR&89*DRR,@A*DRR,@A M+;=MN
  -m< .9->->-@ATQU1Xq[A	A!!P<O!PP' 	8J!4!2++a
+KL MM,7	8 Bs   7Cc                    t        dddd      }d|j                         f}dt        dddd      f}dt        dddd      f}d	t        d
d
dd      f}t        ||||f      }||g}|j                         D 	ci c]  \  }}	t	        |	      | }
}}	|D 	cg c]  \  }}	t	        |	      |f }}}	dD ]1  }|r|}|}n|}|
}|j                  ||      }| j                  ||       3 yc c}	}w c c}	}w )z*Ensures collidedictall detects collisions.r   ri   rz  r{  rx  r|  r}  r   r~  r  r  Nr   r  r  r  r  collidedictallr   r   rG   r  r  r  r  r  r  r  r  r  r  r  r  r  r  s                   r   test_collidedictallz RectTypeTest.test_collidedictall	  s'   Aq"b!$diik2$d1aR&89*DRR,@A*DRR,@A M+;=MN
  -m< .9->->-@ATQU1Xq[A	A7JKtq!eAh]KK' 
	BJ!4!2 //:>M""=.A
	B BKs   7C&C,c                 f   t        dddd      }dt        dddd      f}dt        dddd      f}dt        d	d	dd      f}t        |||f      }|j                         D ci c]  \  }}t        |      | }}}g }	d
D ],  }
|
r|n|}|j	                  ||
      }| j                  ||	       . yc c}}w )z@Ensures collidedictall returns an empty list when no collisions.r   ri   r|  rA   r   r~  r}  r  r  r  Nr   r  r  r  r  r   r   rG   r  r  r  r  r  r  r  r  r  r  r  s                r   !test_collidedictall__no_collisionz.RectTypeTest.test_collidedictall__no_collision5	  s    Aq"b!*DRR,@A*DRR,@A*DRR,@A ,.>@PQR .9->->-@ATQU1Xq[A	A' 	BJ)yA //:>M""=.A	B	 B    B-c           	      8   t        dddd      }t        dddd      }d|f}dt        dddd      f}dt        d	d	dd      f}d
t        dddd      f}t        |||f      }|j                         D 	ci c]  \  }}	t        |	      | }
}}	dD ]  }t	        ||t        ||             dD ]g  }|r|g}t        |      }nt        |d         |d   fg}t        |
      }|j                  |       |j                  ||      }| j                  ||       i  yc c}	}w )zCEnsures collidedictall works correctly for rects that barely touch.r   ri   r   rz  r|  rA   r   r~  r}  r  r  r  r  N)	r   r  r  r  r  r  r+  r  r   )r   rG   r  r  r  r  r  r  r  r  r  r  r  r  r  r  s                   r   $test_collidedictall__barely_touchingz1RectTypeTest.test_collidedictall__barely_touchingL	  s[   Aq"b!Aq!Q'$l3*DRR,@A*DRR,@A*DRR,@A "&/1AB"

 9O8T8T8VW1a!WW I 	FDL$d(;<+ F
&3_N34A',]1-='>a@P&Q%RN12A( $ 3 3Az B&&}nEF	F  Xs   2Dc           	         t        dddd      }t        dddd      }t        dddd      }t        dddd      }t        dddd      }d|j                         f}d|j                         f}d|j                         f}d|j                         f}	d|j                         f}
d	t        ddd
d
      f}dt        dddd      f}t        ||||	|
||f      }|j                         D ci c]  \  }}t	        |      | }}}g }dD ]8  }|r|n|}|||||fD ]&  }|j                  ||      }| j                  ||       ( : yc c}}w )zEnsures collidedictall works correctly with zero sized rects.

        There should be no collisions with zero sized rects.
        r   r   r  r|  r~  r  r  r  r  ri   r  r  Nr  )r   r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  s                         r   %test_collidedictall__zero_sized_rectsz2RectTypeTest.test_collidedictall__zero_sized_rectsq	  s   
 !Q1%
!Q1%
!Q1%
!QA&
!Q2&
*JOO,=>*JOO,=>*JOO,=>*JOO,=>*JOO,=>*DAr2,>?*DAq!,<=        

 .9->->-@ATQU1Xq[A	A' 	FJ)yA  	F	 !* 8 8J G&&}nE	F	F	 Bs   &D?c                 f   t        dddd      }dt        dddd      f}dt        dddd      f}dt        dddd      f}t        |||f      }|j                         D ci c]  \  }}t        |      | }}}g }	dD ],  }
|
r|n|}|j	                  ||
      }| j                  ||	       . yc c}}w )	zEnsures collidedictall works correctly with zero sized rects
        as args.

        There should be no collisions with zero sized rects.
        r   r   r|  r   r~  r  r  Nr  r  s                r   -test_collidedictall__zero_sized_rects_as_argsz:RectTypeTest.test_collidedictall__zero_sized_rects_as_args	  s     Aq"b!*DAq!,<=*DAq!,<=*DAq!,<= ,.>@PQR .9->->-@ATQU1Xq[A	A' 	BJ)yA //:>M""=.A	B	 Br  c                    t        dddd      }d|j                         f}dt        dddd      f}dt        dddd      f}t        |||f      }||g}|j                         D ci c]  \  }}t	        |      | }	}}|D cg c]  \  }}t	        |      |f }
}}dD ]1  }|r|}|}n|
}|	}|j                  ||      }| j                  ||       3 y	c c}}w c c}}w )
zAEnsures collidedictall works correctly with negative sized rects.r   r  rz  r{  r   r   r|  r  Nr  )r   r  r  r  r  r  r  r  r  r  r  r  r  r  r  s                  r   )test_collidedictall__negative_sized_rectsz6RectTypeTest.test_collidedictall__negative_sized_rects	  s	   1b"%$hmmo6$d1aR&89*DAr2,>? M=:JKL,m< .9->->-@ATQU1Xq[A	A7JKtq!eAh]KK' 
	BJ!4!2$33AzBM""=.A
	B BKs   &CCc                    t        dddd      }dt        dddd      f}dt        dddd      f}dt        dddd      f}t        |||f      }|g}|j                         D ci c]  \  }}t        |      | }	}}|D cg c]  \  }}t        |      |f }
}}dD ]1  }|r|}|}n|
}|	}|j	                  ||      }| j                  ||       3 y	c c}}w c c}}w )
zVEnsures collidedictall works correctly with negative sized rect
        args.
        r   ri   rz  r   rQ  r|  r~  r  Nr  )r   rG   r  r  r  r  r  r  r  r  r  r  r  r  r  s                  r   1test_collidedictall__negative_sized_rects_as_argsz>RectTypeTest.test_collidedictall__negative_sized_rects_as_args	  s    Aq"b!$d1aR&89*DAr1,=>*DAq",=> M+;=MNO,o .9->->-@ATQU1Xq[A	A7JKtq!eAh]KK' 
	BJ!4!2 //:>M""=.A
	B BKs   #CCc                     t        dddd      }d|j                         f}t        |d         |d   f}dD ]8  }|r|n|}| j                  t              5  |j                  ||      }ddd       : y# 1 sw Y   ExY w)zAEnsures collidedictall correctly handles invalid dict parameters.r   ri   r  r   r  N)r   r  r  rs   rt   r  r  s          r   (test_collidedictall__invalid_dict_formatz5RectTypeTest.test_collidedictall__invalid_dict_format	  s    Aq"b!'5 !3A!679KA9NN' 	BJ&0"6FA""9- B#221jAB B	BB Br  c                     t        dddd      }t        |      di}| j                  t              5  |j	                  |d      }ddd       y# 1 sw Y   yxY w)zCEnsures collidedictall correctly handles dicts with invalid values.r   ri   r  r   N)r   r  rs   rt   r  )r   rG   r  r  s       r   .test_collidedictall__invalid_dict_value_formatz;RectTypeTest.test_collidedictall__invalid_dict_value_format
  sU    Aq"b!4[),	y) 	> //	1=M	> 	> 	>r  c                     t        dddd      }d|j                         i}| j                  t              5  |j	                  |      }ddd       y# 1 sw Y   yxY w)zAEnsures collidedictall correctly handles dicts with invalid keys.r   ri   r  N)r   r  rs   rt   r  )r   rG   r  r  s       r   ,test_collidedictall__invalid_dict_key_formatz9RectTypeTest.test_collidedictall__invalid_dict_key_format
  sU    Aq"b! $))+.y) 	= //<M	= 	= 	=r  c                     t        dddd      }i }d|dfD ]2  }| j                  t              5  |j                  ||      }ddd       4 y# 1 sw Y   ?xY w)zXEnsures collidedictall correctly handles invalid use_values
        parameters.
        r   r   Nr	  )r   rs   rt   r  )r   rG   r  r  r  s        r   .test_collidedictall__invalid_use_values_formatz;RectTypeTest.test_collidedictall__invalid_use_values_format
  so     Aq!Q"As^ 	FM""9- F $ 3 3A} EF F	FF Fr  c                    t        dddd      }d|j                         f}dt        dddd      f}dt        dddd      f}d	t        d
d
dd      f}t        ||||f      }||g}|j                         D 	ci c]  \  }}	t	        |	      | }
}}	|D 	cg c]  \  }}	t	        |	      |f }}}	dD ]2  }|r|}|}n|}|
}|j                  ||      }| j                  ||       4 yc c}	}w c c}	}w )z@Ensures collidedictall detects collisions via keyword arguments.r   ri   rz  r{  rx  r|  r}  r   r~  r  r  r  Nr  r  s                   r   test_collidedictall__kwargsz(RectTypeTest.test_collidedictall__kwargs!
  s*   Aq"b!$diik2$d1aR&89*DRR,@A*DRR,@A M+;=MN
  -m< .9->->-@ATQU1Xq[A	A7JKtq!eAh]KK' 
	BJ!4!2 //!J/OM""=.A
	B BKs   7C'C-c                    t        dddd      }t        dddd      t        dddd      t        dddd      g}| j                  |j                  |      d       t        dddd      dg}| j                  |j                  |      d       y )Nr   ri   rA   rx  r  rB   rB   r    r    rQ  r   r"   collidelistr   r(   lfs       r   test_collidelistzRectTypeTest.test_collidelist@
  s     Ar2"b!QaB!3T"b!Q5GHq)1-"b!Q!12q)2.r   c                    t        dddd      }t        dddd      t        dddd      t        dddd      g}| j                  |j                  |      d       t        dddd      dg}| j                  |j                  |      d       y )	Nr   ri   rA   rx  r  r  r[  rQ  r  r  s       r   test_collidelist__kwargsz%RectTypeTest.test_collidelist__kwargsR
  s     Ar2"b!QaB!3T"b!Q5GHq)1-"b!Q!12Q/4r   c           	      J   t        dddd      }t        dddd      t        dddd      t        dddd      t        dddd      g}| j                  |j                  |      g d       t        dddd      t        dddd      g}| j                  |j                  |             y 	Nr   ri   rx  r  r   r   r   r   rA   r   r   r"   collidelistallr!  r  s       r   test_collidelistallz RectTypeTest.test_collidelistallc
  s     Ar2 Ar2Ar2RAAq!	
 	))!,i8"b!Qb"a!34))!,-r   c           	          t        dddd      }t        dddd      t        dddd      t        dddd      t        dddd      g}| j                  |j                  |      g        y )	Nr   ri   p   rA   rx  r  r  r   )r   r"   r  )r   r(   r  s      r   &test_collidelistall_returns_empty_listz3RectTypeTest.test_collidelistall_returns_empty_listz
  sp    Ar2 aR QBRAaA	
 	))!,b1r   c                     t        dddd      }g d}| j                  |j                  |      g d       ddg}| j                  |j                  |             y )Nr   ri   r   r   ri   ri   rx  rx  ri   ri   r  r  r   r   r   r   r   r   r  rA   rA   r   r   r   r   rx  rx  r  r  s       r   "test_collidelistall_list_of_tuplesz/RectTypeTest.test_collidelistall_list_of_tuples
  sY    Ar2
 	))!,i8^,))!,-r   c                     t        dddd      }g d}| j                  |j                  |      g d       ddg}| j                  |j                  |             y )Nr   ri   )r   r   ri   ri   rx  rx  r  ))r  r  r  )r  r  r  )rA   rA   r  r  r  r  r  s       r   &test_collidelistall_list_of_two_tuplesz3RectTypeTest.test_collidelistall_list_of_two_tuples
  sZ    Ar2
 	))!,i8!34))!,-r   c                     t        dddd      }g dg dg dg dg}| j                  |j                  |      g d       g dg d	g}| j                  |j                  |             y )
Nr   ri   r  r  r  r  r  r  r  r  r  s       r   !test_collidelistall_list_of_listsz.RectTypeTest.test_collidelistall_list_of_lists
  sg    Ar2 	
 	))!,i8^,))!,-r   c                       e Zd Zd Zy)%RectTypeTest._ObjectWithRectAttributec                     || _         y r
   rS  r'   s     r   __init__z.RectTypeTest._ObjectWithRectAttribute.__init__
  s	    DIr   Nrl  rm  rn  r"  r   r   r   _ObjectWithRectAttributer   
  s    	r   r$  c                       e Zd Zd Zd Zy)-RectTypeTest._ObjectWithCallableRectAttributec                     || _         y r
   _rectr'   s     r   r"  z6RectTypeTest._ObjectWithCallableRectAttribute.__init__
  	    DJr   c                     | j                   S r
   r(  r   s    r   rG   z2RectTypeTest._ObjectWithCallableRectAttribute.rect
  s    ::r   N)rl  rm  rn  r"  rG   r   r   r    _ObjectWithCallableRectAttributer&  
  s    		r   r-  c                   "    e Zd Zd Zed        Zy)$RectTypeTest._ObjectWithRectPropertyc                     || _         y r
   r(  r'   s     r   r"  z-RectTypeTest._ObjectWithRectProperty.__init__
  r*  r   c                     | j                   S r
   r(  r,  s    r   rG   z)RectTypeTest._ObjectWithRectProperty.rect
  s    ::r   N)rl  rm  rn  r"  propertyrG   r   r   r   _ObjectWithRectPropertyr/  
  s    	 
	 
	r   r3  c                       e Zd Zd Zy)-RectTypeTest._ObjectWithMultipleRectAttributec                 .    || _         || _        || _        y r
   )rect1r3  rect3rX  s       r   r"  z6RectTypeTest._ObjectWithMultipleRectAttribute.__init__
  s    DJDJDJr   Nr#  r   r   r    _ObjectWithMultipleRectAttributer5  
  s    	r   r9  c                    t        dddd      }| j                  t        dddd            | j                  t        dddd            | j                  t        dddd            | j                  t        dddd            g}| j                  |j                  |      g d       | j                  t        dddd            | j                  t        dddd            g}| j	                  |j                  |             y r  )r   r$  r"   r  r!  r  s       r   6test_collidelistall_list_of_object_with_rect_attributezCRectTypeTest.test_collidelistall_list_of_object_with_rect_attribute
  s    Ar2 ))$q!R*<=))$q!R*<=))$r2q!*<=))$q!Q*:;	
 	))!,i8 ))$r2q!*<=))$r2q!*<=
 	))!,-r   c                    t        dddd      }| j                  t        dddd            | j                  t        dddd            | j                  t        dddd            | j                  t        dddd            g}| j                  |j                  |      g d       | j                  t        dddd            | j                  t        dddd            g}| j	                  |j                  |             y r  )r   r-  r"   r  r!  r  s       r   ?test_collidelistall_list_of_object_with_callable_rect_attributezLRectTypeTest.test_collidelistall_list_of_object_with_callable_rect_attribute
  s    Ar2 11$q!R2DE11$q!R2DE11$r2q!2DE11$q!Q2BC	
 	))!,i8 11$r2q!2DE11$r2q!2DE
 	))!,-r   c                 v   t        dddd      }| j                  | j                  t        dddd                  | j                  | j                  t        dddd                  | j                  | j                  t        dddd                  | j                  | j                  t        dddd                  g}| j                  |j	                  |      g d       | j                  t        dddd            | j                  t        dddd            g}| j                  |j	                  |             y r  )r   r-  r$  r"   r  r!  r  s       r   Ztest_collidelistall_list_of_object_with_callable_rect_returning_object_with_rect_attributezgRectTypeTest.test_collidelistall_list_of_object_with_callable_rect_returning_object_with_rect_attribute
  s2    Ar2 11--d1aR.@A 11--d1aR.@A 11--d2r1a.@A 11--d1aA.>?
 	))!,i8 11$r2q!2DE11$r2q!2DE
 	))!,-r   c                    t        dddd      }| j                  t        dddd            | j                  t        dddd            | j                  t        dddd            | j                  t        dddd            g}| j                  |j                  |      g d       | j                  t        dddd            | j                  t        dddd            g}| j	                  |j                  |             y r  )r   r3  r"   r  r!  r  s       r   5test_collidelistall_list_of_object_with_rect_propertyzBRectTypeTest.test_collidelistall_list_of_object_with_rect_property  s    Ar2 ((aB);<((aB);<((b"a);<((aAq)9:	
 	))!,i8 ((b"a);<((b"a);<
 	))!,-r   c           	      L   t        dddd      }t        dddd      t        dddd      t        dddd      t        dddd      g}| j                  |j                  |      g d       t        dddd      t        dddd      g}| j                  |j                  |	             y )
Nr   ri   rx  r  r   r  rA   r   r[  r  r  s       r   test_collidelistall__kwargsz(RectTypeTest.test_collidelistall__kwargs  s     Ar2 Ar2Ar2RAAq!	
 	))!,i8"b!Qb"a!34)))23r   c                    t        dddd      }t        dddd      t        dddd      g}| j                  t        dddd      t        dddd      t        d	d
dd            | j                  t        dddd      t        dddd      t        d	d
dd            g}|j                  |       |j                  |d        |j                  |d        | j                  t        |j                  |       y )Nr   ri   r   r   r    r   r   r  rB   rD   ,    keyc                     | j                   S r
   r7  os    r   r  z@RectTypeTest.test_collideobjects_call_variants.<locals>.<lambda>;  s
     r   )r   r9  collideobjectsrs   rt   r   r(   r\  objectss       r   !test_collideobjects_call_variantsz.RectTypeTest.test_collideobjects_call_variants+  s    Ar2aAq!4BB#7811Q1a $r2r2"6S#sC8P 11Q1a $r2r2"6S#sC8P	
 	
	D)	&78)Q%5%5w?r   c                    t        dddd      }t        dddd      t        dddd      t        dddd      g| j                  t        dddd            | j                  t        dddd            | j                  t        dddd            g| j                  t        dddd            | j                  t        dddd            | j                  t        dddd            g| j                  t        dddd            | j                  t        dddd            | j                  t        dddd            g| j                  | j                  t        dddd                  | j                  | j                  t        dddd                  | j                  | j                  t        dddd                  gg dg dg dg d	g d
gt        dddd      | j                  t        dddd            d
gg	}|D ]Z  }| j	                  |d   j
                  j                        5  |j                  |      }| j                  ||d          d d d        \ t        dddd      t        dddd      g| j                  t        dddd            | j                  t        dddd            g| j                  t        dddd            | j                  t        dddd            g| j                  t        dddd            | j                  t        dddd            g| j                  | j                  t        dddd                  | j                  | j                  t        dddd                  gddgddgg dg dgt        dddd      g dgg	}|D ]X  }| j	                  |d   j
                  j                  d       5  |j                  |      }| j                  |d        d d d        Z y # 1 sw Y   xY w# 1 sw Y   rxY w)Nr   ri   rA   rx  r    )r  r  r    r    r   r   )r  r  )r    r    r  r  r  rR  r   typerB   r  r  ))rB   rB   rS  rU  r  )	r   r$  r3  r-  r  	__class__rl  rM  r"   )r   r(   types_to_testr  r_  r  s         r   test_collideobjects_without_keyz,RectTypeTest.test_collideobjects_without_key>  s(   Ar2"b!QaB!3T!Q15EF--d2r1a.@A--d1aR.@A--d1aA.>? ,,T"b!Q-?@,,T!QB-?@,,T!Q1-=> 55d2r1a6HI55d1aR6HI55d1aA6FG 5511$r2q!2DE 5511$q!R2DE 5511$q!Q2BC
 ;F^\:RQ"--d1aR.@A?$
L  	/A1Q4>>#:#:; /))!,  1.	/ /	/ "b!Qc31!56--d2r1a.@A--d3Q.BC
 ,,T"b!Q-?@,,T#sAq-AB
 55d2r1a6HI55d3Q6JK
 5511$r2q!2DE 5511$sCA2FG	 -.!56-."b!Q!123
8  	/A1Q4>>#:#:TJ /))!,  .	/ /	/E/ /F/ /s   #'O/ $O</O9	<P	c                 l   t        dddd      }| j                  t        dddd      t        dddd      t        dddd            | j                  t        dddd      t        dddd      t        dddd            | j                  t        dddd      t        dddd      t        dd	dd            | j                  t        d
d
dd      t        dddd      t        dddd            g}| j                  |j                  |d       |d          | j                  |j                  |d       |d          | j                  |j                  |d       |d          | j                  t        dddd      t        dddd      t        d
dd
d
            | j                  t        dddd      t        dddd      t        dd
d
d
            g}| j	                  |j                  |d              | j	                  |j                  |d              | j	                  |j                  |d              y )Nr   ri   rx  r   r  r  rB   S   r   r(  c                     | j                   S r
   rJ  rK  s    r   r  z^RectTypeTest.test_collideobjects_list_of_object_with_multiple_rect_attribute.<locals>.<lambda>  
     r   rG  r   c                     | j                   S r
   r3  rK  s    r   r  z^RectTypeTest.test_collideobjects_list_of_object_with_multiple_rect_attribute.<locals>.<lambda>  r_  r   c                     | j                   S r
   r8  rK  s    r   r  z^RectTypeTest.test_collideobjects_list_of_object_with_multiple_rect_attribute.<locals>.<lambda>  r_  r   rA   r  r   r  c                     | j                   S r
   rJ  rK  s    r   r  z^RectTypeTest.test_collideobjects_list_of_object_with_multiple_rect_attribute.<locals>.<lambda>  
    agg r   c                     | j                   S r
   ra  rK  s    r   r  z^RectTypeTest.test_collideobjects_list_of_object_with_multiple_rect_attribute.<locals>.<lambda>  rf  r   c                     | j                   S r
   rc  rK  s    r   r  z^RectTypeTest.test_collideobjects_list_of_object_with_multiple_rect_attribute.<locals>.<lambda>  rf  r   )r   r9  r"   rM  r!  collideobjectsallr   r(   thingsr  s       r   ?test_collideobjects_list_of_object_with_multiple_rect_attributezLRectTypeTest.test_collideobjects_list_of_object_with_multiple_rect_attribute  sC   Ar2 11Q2r"DAq!$4d31a6H 11Q2r"DRR$8$q!Q:J 11RQ"DaA$6QAq8I 11Q1a $q#r2"6Q1a8H
 	))&6G)H&QR)T))&6G)H&QR)T))&6G)H&QR)T 11RQ"DQ1$5tAsAq7I 11RQ"DB1$5tCAq7I	
 	,,Q4E,FG,,Q4E,FG,,Q4E,FGr   c                    t        dddd      }t        dddd      t        dddd      g}| j                  t        dddd      t        dddd      t        d	d
dd            | j                  t        dddd      t        dddd      t        d	d
dd            g}|j                  |       |j                  |d        |j                  |d        | j                  t        |j                  |       y )Nr   ri   r   r   r    r   r   r  rB   rD   rE  rF  rG  c                     | j                   S r
   rJ  rK  s    r   r  zCRectTypeTest.test_collideobjectsall_call_variants.<locals>.<lambda>  s
    177 r   )r   r9  ri  rs   rt   rN  s       r   $test_collideobjectsall_call_variantsz1RectTypeTest.test_collideobjectsall_call_variants  s    Ar2aAq!4BB#7811Q1a $r2r2"6S#sC8P 11Q1a $r2r2"6S#sC8P	
 	
E"	Et,	G):;)Q%8%8'Br   c                    t        dddd      }t        dddd      t        dddd      t        dddd      t        dddd      gg dg dg dg d	g d
g dg| j                  t        dddd            | j                  t        dddd            | j                  t        dddd            | j                  t        dddd            g| j                  t        dddd            | j                  t        dddd            | j                  t        dddd            | j                  t        dddd            g| j                  | j                  t        dddd                  | j                  | j                  t        dddd                  | j                  | j                  t        dddd                  | j                  | j                  t        dddd                  g| j                  t        dddd            | j                  t        dddd            | j                  t        dddd            | j                  t        dddd            gg}|D ]e  }| j	                  |d   j
                  j                        5  |j                  |d       }| j                  ||d   |d   |d   g       d d d        g t        dddd      t        dddd      gddgddgg dg dg| j                  t        dddd            | j                  t        dddd            g| j                  t        dddd            | j                  t        dddd            g| j                  t        dddd            | j                  t        dddd            g| j                  t        dddd            | j                  t        dddd            gg}|D ]W  }| j	                  |d   j
                  j                  d       5  |j                  |      }| j                  |       d d d        Y y # 1 sw Y   xY w# 1 sw Y   qxY w)Nr   ri   rx  r  r   r  r  r  r  r  r  r   rT  rG  r   rA   r   r  r  r  r  rV  )
r   r$  r-  r3  r  rW  rl  ri  r"   r!  )r   r(   rX  rk  r_  r  s         r   test_collideobjectsallz#RectTypeTest.test_collideobjectsall  sr   Ar2 Q2r"Q2r"RQ"Q1a 	 	 --d1aR.@A--d1aR.@A--d2r1a.@A--d1aA.>?	 55d1aR6HI55d1aR6HI55d2r1a6HI55d1aA6FG	 5511$q!R2DE 5511$q!R2DE 5511$r2q!2DE 5511$q!Q2BC ,,T!QB-?@,,T!QB-?@,,T"b!Q-?@,,T!Q1-=>	g9
t $ 	LF6!9#6#6#?#?@ L,,V,>  &)VAYq	)JK	L L	L "b!Qb"a!34^,!34^,--d2r1a.@A--d2r1a.@A
 55d2r1a6HI55d2r1a6HI
 55d2r1a6HI55d2r1a6HI
 ,,T"b!Q-?@,,T"b!Q-?@#
,  	)A1Q4>>#:#:TJ ),,Q/  (	) )	)9L L:) )s   2P. #P;.P8	;Q	c                    t        dddd      }| j                  t        dddd      t        dddd      t        dddd            | j                  t        dddd      t        dddd      t        dddd            | j                  t        dddd      t        dddd      t        dd	dd            | j                  t        d
d
dd      t        dddd      t        dddd            g}| j                  |j                  |d       |d   |d   |d   g       | j                  |j                  |d       |d   |d   g       | j                  |j                  |d       |d   |d   g       | j                  t        dddd      t        dddd      t        d
dd
d
            | j                  t        dddd      t        dddd      t        dd
d
d
            g}| j	                  |j                  |d              | j	                  |j                  |d              | j	                  |j                  |d              y )Nr   ri   rx  r[  r   r  r  rB   r\  r   r]  r(  c                     | j                   S r
   rJ  rK  s    r   r  zaRectTypeTest.test_collideobjectsall_list_of_object_with_multiple_rect_attribute.<locals>.<lambda>7  
    agg r   rG  r   c                     | j                   S r
   ra  rK  s    r   r  zaRectTypeTest.test_collideobjectsall_list_of_object_with_multiple_rect_attribute.<locals>.<lambda>;  rt  r   c                     | j                   S r
   rc  rK  s    r   r  zaRectTypeTest.test_collideobjectsall_list_of_object_with_multiple_rect_attribute.<locals>.<lambda>>  rt  r   rA   r  rd  r   r  c                     | j                   S r
   rJ  rK  s    r   r  zaRectTypeTest.test_collideobjectsall_list_of_object_with_multiple_rect_attribute.<locals>.<lambda>I  rf  r   c                     | j                   S r
   ra  rK  s    r   r  zaRectTypeTest.test_collideobjectsall_list_of_object_with_multiple_rect_attribute.<locals>.<lambda>J  rf  r   c                     | j                   S r
   rc  rK  s    r   r  zaRectTypeTest.test_collideobjectsall_list_of_object_with_multiple_rect_attribute.<locals>.<lambda>K  rf  r   )r   r9  r"   ri  r!  rj  s       r   Btest_collideobjectsall_list_of_object_with_multiple_rect_attributezORectTypeTest.test_collideobjectsall_list_of_object_with_multiple_rect_attribute%  sq   Ar2 11Q2r"DAq!$4d31a6H 11Q2r"DRR$8$q!Q:J 11RQ"DaA$6QAq8I 11Q1a $q#r2"6Q1a8H
 	,=>AYq	6!9-	
 	,=>FSTI@V	
 	,=>FSTI@V	

 11RQ"DQ1$5tAsAq7I 11RQ"DB1$5tCAq7I	
 	,,Q4E,FG,,Q4E,FG,,Q4E,FGr   c                     t        dddd      }t        dddd      }|j                  |      }| j                  |j                  |             |j                  |      }| j                  |j                  |             y )Nri   r   r  )r   fitr  r   )r   r(   r,  r  f2s        r   test_fitzRectTypeTest.test_fitM  sf     RR "b"b!EE"IA'VVAY

2'r   c                 d    t        dddd      }|j                         }| j                  ||       y )Nr   r   ri   r   )r   r  r"   r|  s      r   	test_copyzRectTypeTest.test_copya  s-    Ar2FFHAr   c                    t        dd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        |j                  d	       | j                  t        |j                  d
       | j                  |dd ddg       | j                  |dd g d       | j                  |dd g d       | j                  |d d  g d       | j                  |d   g d       | j                  |ddd   ddg       | j                  |ddd   ddg       | j                  |dd d   g d       | j                  t
        |j                  d        y )Nr   r   r   r    r   rQ  r  r0  rx  r  r1  rr   .)r    r   r   r   )r   r"   rs   
IndexError__getitem__rt   r'   s     r   test_subscriptzRectTypeTest.test_subscriptf  s   Aq!1q!1q!1q!1q!2"2"2"*ammQ7*ammR81Q!Q(1Q.1R),1|,3.1Qq5Aq6*1Qq5Aq6*15b5<0)Q]]D9r   c                    t        dddd      }d|d<   | j                  |g d       | j                  t        |j                  d d       | j                  |g d       | j                  t        |j                  dd       | j                  |g d       | j                  t
        |j                  dd       | j                  |g d       | j                  t
        |j                  dd       | j                  |g d       d|d<   | j                  |g d       d	|d
<   | j                  |g d       d|d<   | j                  |g d       d|d<   | j                  |g d       d|dd
 | j                  |g d       d|d<   | j                  |g d       d|d d  | j                  |g d       d|d d  | j                  |g d       ||d d d<   | j                  |g d       y )Nr   r1  . r    r  ri   )ri   r   r   r    r  r   )ri   r   r   r  rF  rQ  )ri   r   r   rF  rB   r0  )rB   r   r   rF  r   )rB   r   r   rF  )r   r   r   r   	   )r  r  r  r  )r  rw        )r  r  rw  r  )r   r"   rs   rt   __setitem__r  r'   s     r   test_ass_subscriptzRectTypeTest.test_ass_subscript{  s   Aq!#L))Q]]D!<L))Q]]Ar:L)*ammQ:L)*ammR;L)!M*!N+"O,",-!A,-#L)!L)!,-$B$,-r   c                 2   t        dddd      }| j                  t              5  |d= d d d        | j                  t              5  |dd= d d d        | j                  t              5  |d= d d d        y # 1 sw Y   NxY w# 1 sw Y   7xY w# 1 sw Y   y xY w)Nr   r   .)r   rs   rt   r'   s     r   test_ass_subscript_deletionz(RectTypeTest.test_ass_subscript_deletion  s    Aq!y) 	!	 y) 	!A#	 y) 	#	 		 		 		 	s#   A5B(B5A>B
Bc                     t        dddd      }| j                  t        |t                     | j	                  t        |t
                     y Nr$  r  K   r   )r   r  
isinstancer   r!  r   r'   s     r   test_collection_abcz RectTypeTest.test_collection_abc  s:    RR 
1j12Ax01r   N)rl  rm  rn  r   r)   r-   r?   rK   rX   r[   r_   rb   rd   rg   rn   rw   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   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-  r1  r5  r8  r>  r@  rD  rG  rJ  rM  rO  rZ  r`  rc  re  rg  rk  rm  ro  rq  rs  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  unittestskipIfIS_PYPYr!  r(  r-  r/  r4  r6  r<  r>  rA  rI  rQ  rT  rY  r]  r`  rx  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-  r3  r9  r;  r=  r?  rA  rC  rP  rY  rl  ro  rq  rz  r~  r  r  r  r  r  r   r   r   r   r      s   /&&;,+
>
>
>
>
>B0 0 	5- 	)/!-"/"
+"+%+#+&+!+"+#+!+$
1 
1!1I>
B222222222$2$3")H
(
(
(
(222	0--
;"C,C0? ? G2G2;&;,H&?&-?^?>2?h!?F?*?	?5Cn40** X__PlYlY\gR))	)	);
11191	4	4!
F <D8@,*#CJ/0b,07:?4?:9B8@B>B.#FJ1FfB6B8B<B>=	FB>/$5"..	2...    .".".6."4*@&P/dHBC&_)B&HP((
:*.>	2r   r   c                   X    e Zd Z G d de      Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zy)SubclassTestc                        e Zd Z fdZ xZS )SubclassTest.MyRectc                 N    t        t        j                  |   |i | d| _        y )NT)superr  MyRectr"  an_attribute)r   r   kwdsrW  s      r   r"  zSubclassTest.MyRect.__init__  s%    ,%%t5tDtD $Dr   )rl  rm  rn  r"  __classcell__)rW  s   @r   r  r    s    	% 	%r   r  c                    | j                  dddd      }| j                  |j                         |j                         }| j                  t	        || j                                | j                  t        t        |d       y Nr   r   ri   r   r  )r  r  r  r  r  rs   r{   r  r   mr1mr2s      r   r  zSubclassTest.test_copy  s^    kk!QB'(()hhj
345.'3Gr   c                    | j                  dddd      }| j                  |j                         |j                  dd      }| j                  t	        || j                                | j                  t        t        |d       y r  )r  r  r  r  r  rs   r{   r  r  s      r   r  zSubclassTest.test_move  sb    kk!QB'(()hhq!n
345.'3Gr   c                    | j                  dddd      }| j                  |j                         |j                  dd      }| j                  t	        || j                                | j                  t        t        |d       y )Nr   r   ri   r   r    r  )r  r  r  r*  r  rs   r{   r  r  s      r   test_inflatezSubclassTest.test_inflate  sc    kk!QB'(()kk!Q
345.'3Gr   c                    | j                  dddd      }| j                  |j                         |j                  t	        dddd            }| j                  t        || j                                | j                  t        t        |d       y )Nrv  rw  rx  ri   r  )	r  r  r  r{  r   r  rs   r{   r  r  s      r   r~  zSubclassTest.test_clamp  sl    kk"b!Q'(()iiRR,-
345.'3Gr   c                    | j                  dddd      }| j                  |j                         |j                  t	        dddd            }| j                  t        || j                                | j                  t        t        |d       y )Nr   r   r   r    r   r  )	r  r  r  r  r   r  rs   r{   r  r  s      r   r  zSubclassTest.test_clip  sl    kk!Q1%(()hhtAq!Q'(
345.'3Gr   c                    | j                  dddd      }| j                  |j                         |j                  t	        dddd            }| j                  t        || j                                | j                  t        t        |d       y )Nr   r   r  r  )	r  r  r  r:  r   r  rs   r{   r  r  s      r   r<  zSubclassTest.test_union  sl    kk!Q1%(()iiRQ*+
345.'3Gr   c           	      :   | j                  dddd      }| j                  |j                         |j                  t	        dddd      t	        dddd      g      }| j                  t        || j                                | j                  t        t        |d       y )Nr   r   r  r   r  )	r  r  r  rE  r   r  rs   r{   r  r  s      r   rI  zSubclassTest.test_unionall  s|    kk!Q1%(()llDRA.Q1a0@AB
345.'3Gr   c                    | j                  dddd      }| j                  |j                         |j                  t	        dddd            }| j                  t        || j                                | j                  t        t        |d       y )Nri   r   r  r  )	r  r  r  r|  r   r  rs   r{   r  r  s      r   r~  zSubclassTest.test_fit  sl    kk"b"b)(()ggd2r2r*+
345.'3Gr   c                     | j                  dddd      }| j                  t        |t                     | j	                  t        |t
                     y r  )r  r  r  r   r!  r   )r   r  s     r   r  z SubclassTest.test_collection_abc  s>    kk"b"b)
3
34C23r   N)rl  rm  rn  r   r  r  r  r  r~  r  r<  rI  r~  r  r   r   r   r  r    sC    % %
HHHHHHHH4r   r  __main__)r  r  collections.abcr   r   platformr   pygamer   r   pygame.testsr   python_implementationr  r   r   r   TestCaser   r  rl  mainr   r   r   <module>r     s      0     #
2H224
4 .S228$$ S22ldA48$$ A4H zHMMO r   