def test_direction_snake_RIGHT(): snake = Snake() position_o = [90, 50] snake.change = "RIGHT" snake.direction = "UP" snake.changeDirection() assert (snake.direction == "RIGHT") assert (snake.position[0] == (position_o[0] + 10))
def test_direction_snake_RIGHT(): snake = Snake() #Position Erronea antes [90, 50] pero lo correcto es [100, 50] si no el test falla position_o = [100, 50] snake.change = "RIGHT" snake.direction = "UP" snake.changeDirection() assert (snake.direction == "RIGHT") assert (snake.position[0] == (position_o[0] + 10))
def test_direction_snake_LEFT(): snake = Snake() position_o = [100, 50] snake.change = "LEFT" snake.direction = "UP" snake.changeDirection() assert (snake.direction == "LEFT") assert (snake.position[0] == (position_o[0] - 10))
def test_direction_snake_DOWN(): snake = Snake() position_o = [100, 40] snake.change = "DOWN" snake.direction = "RIGHT" snake.changeDirection() assert (snake.direction == "DOWN") assert (snake.position[1] == (position_o[1] + 10)) del snake
def test_direction_snake_UP(): snake = Snake() position_o = [100, 50] snake.change = "UP" snake.direction = "RIGHT" snake.changeDirection() assert (snake.direction == "UP") assert (snake.position[1] == (position_o[1] - 10)) del snake
def test_direction_snake_DOWN(): snake = Snake() #Position Erronea antes [100, 40] pero lo correcto es [100, 50] si no el test falla position_o = [100, 50] snake.change = "DOWN" snake.direction = "RIGHT" snake.changeDirection() assert (snake.direction == "DOWN") assert (snake.position[1] == (position_o[1] + 10)) del snake