Exemplo n.º 1
0
class SpawnManagerIgnoramusTests(unittest.TestCase):
    
    def setUp(self):
        self.spawn_manager = SpawnManagerIgnoramus(10, 10)

    def test_get_spawn(self):
        snake = Snake()
        snake.head = (3, 7)
        snake.joints = [(6, 7), (6, 3), (5, 3), (5, 2), (7, 2), (7, 8), (3, 8)]
        snake_squares = snake.enumerate_snake_squares()

        for _ in range(100):
            food_coords = self.spawn_manager.get_spawn(snake)
            self.assertTrue(food_coords not in snake_squares)
Exemplo n.º 2
0
 def setUp(self):
     self.spawn_manager = SpawnManagerIgnoramus(10, 10)