Ejemplo n.º 1
0
    def test_pygame2_base_Rect_top(self):

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

        # Gets or sets the top edge position of the Rect.
        r = Rect( 1, 2, 3, 4 )
        new_top = 10
        
        r.top = new_top
        self.assertEqual( Rect(1,new_top,3,4), r )
        self.assertEqual( new_top, r.top )
Ejemplo n.º 2
0
    def test_pygame2_base_Rect_y(self):

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

        # Gets or sets the vertical top left position of the Rect.
        r = Rect (1, 2, 3, 4)
        self.assertEqual (r.y, 2)
        r.topleft = 32, 10
        self.assertEqual (r.y, 10)
        r.top = -44
        self.assertEqual (r.y, -44)
        r.move_ip (10, 33)
        self.assertEqual (r.y, -11)