Exemplo n.º 1
0
    def test_is_users_move_confirms_users_move(self):
        user = User()
        game = Game()

        game.first_player = user
        game.status = "F"

        self.assertTrue(game.is_users_move(user))
Exemplo n.º 2
0
    def test_is_users_move_stops_wrong_users_move(self):
        user1 = User()
        user2 = User()
        game = Game()

        game.first_player = user1
        game.second_player = user2
        game.status = "F"

        self.assertFalse(game.is_users_move(user2))
Exemplo n.º 3
0
    def test_new_move_prevents_move_in_completed_game(self):
        game = Game()
        game.status = "W"

        self.assertRaises(ValueError, lambda: game.new_move())
Exemplo n.º 4
0
    def test_new_move_returns_move(self):
        game = Game()
        game.status = "F"

        self.assertTrue(isinstance(game.new_move(), Move))