Exemplo n.º 1
0
 def test_union_ip__list( self ):
     r1 = Rect( 0, 0, 1, 1 )
     r2 = Rect( -2, -2, 1, 1 )
     r3 = Rect( 2, 2, 1, 1 )
     
     r1.union_ip( [r2,r3] )
     self.assertEqual( Rect(-2, -2, 5, 5), r1 )
Exemplo n.º 2
0
    def test_pygame2_base_Rect_union_ip(self):

        # __doc__ (as of 2008-10-17) for pygame2.base.Rect.union_ip:

        # Rect.union_ip (Rect) -> Rect
        # 
        # Joins two rectangles into one, in place.
        # 
        # Same as Rect.union(Rect), but operates in place.
        r1 = Rect( 1, 1, 1, 2 )
        r2 = Rect( -2, -2, 1, 2 )
        r1.union_ip(r2)
        self.assertEqual( Rect( -2, -2, 4, 5 ), r1 )