Example #1
0
def test_should_change_position_when_move_called():
    position = Position(X_POSITION_VALUE, Y_POSITION_VALUE)
    position.move_x(X_MOVE_BY)
    position.move_y(Y_MOVE_BY)

    assert position.x_position == X_POSITION_VALUE + X_MOVE_BY
    assert position.y_position == Y_POSITION_VALUE + Y_MOVE_BY
class Snake:
    def __init__(self, x_position: int, y_position: int):
        self.length = 0
        self.position = Position(x_position, y_position)

    def move_x(self, move_x: int):
        self.position.move_x(move_x)

    def move_y(self, move_y: int):
        self.position.move_y(move_y)