def test_invalid_protocol(self): player1 = GoPlayerBase() self.assertRaisesAny(player1.receive_stone, StoneEnum.BLACK) player2 = GoPlayerBase() player2.register() history = get_simple_history_3() self.assertRaisesAny(player2.choose_move, history) player3 = GoPlayerBase() self.assertRaisesAny(player3.choose_move, history)
def test_receive_stone(self): player1 = GoPlayerBase("player1") player1.register() self.assertEqual(None, player1.stone_type) player1.receive_stone(StoneEnum.BLACK) self.assertEqual(StoneEnum.BLACK, player1.stone_type) player2 = GoPlayerBase("player2") player2.register() self.assertEqual(None, player2.stone_type) player2.receive_stone(StoneEnum.WHITE) self.assertEqual(StoneEnum.WHITE, player2.stone_type)
def init_player(): player = GoPlayerBase() player.register() player.receive_stone(StoneEnum.BLACK) return player
def test_register(self): player = GoPlayerBase() self.assertEqual("default_player", player.register())