예제 #1
0
 def test5(self):
     """ Comprobar que el juego no se termina cuando el ratón tiene aún una salida"""
     game = Game(cat_user=self.users[0])
     game.full_clean()
     game.mouse_user = self.users[1]
     game.cat1 = 38
     game.cat2 = 52
     game.cat3 = 54
     game.mouse = 45
     game.save()
     self.assertEqual(game.status, GameStatus.ACTIVE)
예제 #2
0
 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)
예제 #3
0
 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)
예제 #4
0
 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)
예제 #5
0
파일: tests_win.py 프로젝트: v0sem/Django4
    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)