def test_play_legal_move_white(P, player, point): p = P(row=point[0], col=point[1]) v = Vertex.from_point(p) assert Command.play( player, p).to_string() == f"{CommandType.PLAY.value} {Color.WHITE.value} {v}"
def test_play_pass(player): assert Command.play( player, "pass").to_string() == f"{CommandType.PLAY.value} {player.value} pass"
def test_komi(komi): assert Command.komi(komi).to_string() == f"{CommandType.KOMI.value} {komi}"
def test_genmove_with_color(color): assert Command.genmove( color).to_string() == f"{CommandType.GENMOVE.value} {color.value}"
def test_clear_board(): assert Command.clear_board().to_string( ) == f"{CommandType.CLEAR_BOARD.value}"
def test_boardsize_with_invalid_size(size): with pytest.raises(ValueError): Command.boardsize(size)
def test_boardsize_with_valid_size(size): assert Command.boardsize( size).to_string() == f"{CommandType.BOARDSIZE.value} {size}"