def testGenerateRandomFoodPositionOverSnakeFuzzTest(self): for i in range(100): snake = Snake() snakeCoordinatesList = snake.getSnakeCoordinates() snake.generateRandomFoodCoordinates(FOOD_STARTING_NUMBER) for foodCoordinates in snake.getFoodCoordinates(): if foodCoordinates in snakeCoordinatesList: raise AssertionError("Generated food coordinates shouldn't overlap snake!!!")
def testCreateNewFoodPositionOverFoodPositionFuzzTest(self): snake = Snake() for i in range(380): snake.generateRandomFoodCoordinates(1) seen = list() for foodCoordinates in snake.getFoodCoordinates(): if foodCoordinates in seen: raise AssertionError("Generated food coordinates shouldn't overlap other food coordinates!!!") else: seen.append(foodCoordinates)
def testGenerateRandomFoodPositionOverFoodPositionFuzzTest(self): for i in range(100): snake = Snake() snake.generateRandomFoodCoordinates(FOOD_STARTING_NUMBER) seen = list() for foodCoordinates in snake.getFoodCoordinates(): if foodCoordinates in seen: raise AssertionError("Generated food coordinates shouldn't overlap other food coordinates!!!") else: seen.append(foodCoordinates)
def testGenerateRandomFoodPosition(self): snake = Snake() snake2 = Snake() snake.generateRandomFoodCoordinates(FOOD_STARTING_NUMBER) snake2.generateRandomFoodCoordinates(FOOD_STARTING_NUMBER) assert_that(snake.getFoodCoordinates(), not equal_to(snake2.getFoodCoordinates()))