Exemplo n.º 1
0
    def test_pygame2_base_Rect_left(self):

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

        # Gets or sets the left edge position of the Rect.
        r = Rect( 1, 2, 3, 4 )
        new_left = 10
        
        r.left = new_left
        self.assertEqual( new_left, r.left )
        self.assertEqual( Rect(new_left,2,3,4), r )
Exemplo n.º 2
0
    def test_pygame2_base_Rect_x(self):

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

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