def test6(self): """ Comprobar que el juego se termina correctamente cuando el ratón está completamente rodeado""" game = Game(cat_user=self.users[0]) game.full_clean() game.mouse_user = self.users[1] game.cat1 = 36 game.cat2 = 38 game.cat3 = 52 game.cat4 = 54 game.mouse = 45 game.save() self.assertEqual(game.status, GameStatus.FINISHED)
def test7(self): """ Comprobar que el juego no se termina cuando el ratón ha superado a la mitad de los gatos""" game = Game(cat_user=self.users[0]) game.full_clean() game.mouse_user = self.users[1] game.cat1 = 34 game.cat2 = 38 game.cat3 = 52 game.cat4 = 54 game.mouse = 45 game.save() self.assertEqual(game.status, GameStatus.ACTIVE)
def test8(self): """ Comprobar que el juego se termina correctamente cuando el ratón ha superado a los gatos""" game = Game(cat_user=self.users[0]) game.full_clean() game.mouse_user = self.users[1] game.cat1 = 36 game.cat2 = 38 game.cat3 = 52 game.cat4 = 54 game.mouse = 20 game.save() self.assertEqual(game.status, GameStatus.FINISHED)
def test1(self): """ Validación de la actualización del juego al ganar el raton""" game = Game(cat_user=self.user1) game.save() game.cat1 = 57 game.cat2 = 59 game.cat3 = 61 game.cat4 = 63 game.mouse = 18 game.mouse_user = self.user2 game.cat_turn = False game.save() move = Move(origin=18, target=11, player=self.user2, game=game) move.save() self.assertEqual(game.status, GameStatus.FINISHED)