コード例 #1
0
    def test3(self):
        #
        # Multi tables sit-n-go
        #
        seats_per_game = 10
        games_count = 2
        players_count = seats_per_game * games_count
        tourney = PokerTournament(
            name = 'Test create',
            players_quota = players_count,
            dirs = [path.join(TESTS_PATH, '../conf')],
            seats_per_game = seats_per_game
        )

        for serial in xrange(1,players_count + 1):
            self.failUnless(tourney.register(serial))

        self.assertEqual(len(tourney.games), games_count)
        for game in tourney.games:
            for serial in game.serialsAll():
                game.botPlayer(serial)
        turn = 1
        running = True
        while running:
            turn += 1
            if turn >= 200: raise Exception('Suspecting infity loop (more than 200 turns were played).')
            for game in tourney.games:
                if game.sitCount() > 1:
                    game.beginTurn(turn)
                    tourney.removeBrokePlayers(game.id, now=True)
                    if game.id in tourney.id2game and not tourney.tourneyEnd(game.id):
                        running = False 
                        break
コード例 #2
0
    def test3(self):
        #
        # Multi tables sit-n-go
        #
        seats_per_game = 10
        games_count = 2
        players_count = seats_per_game * games_count
        tourney = PokerTournament(
            name = 'Test create',
            players_quota = players_count,
            dirs = [path.join(TESTS_PATH, '../conf')],
            seats_per_game = seats_per_game
        )

        for serial in xrange(1,players_count + 1):
            self.failUnless(tourney.register(serial))

        self.assertEqual(len(tourney.games), games_count)
        for game in tourney.games:
            for serial in game.serialsAll():
                game.botPlayer(serial)
        turn = 1
        running = True
        while running:
            turn += 1
            if turn >= 200: raise Exception('Suspecting infity loop (more than 200 turns were played).')
            for game in tourney.games:
                if game.sitCount() > 1:
                    game.beginTurn(turn)
                    tourney.removeBrokePlayers(game.id, now=True)
                    if game.id in tourney.id2game and not tourney.tourneyEnd(game.id):
                        running = False 
                        break
コード例 #3
0
    def test1(self):
        tourney = PokerTournament(
            name = 'Test create',
            players_quota = 4,
            dirs = [path.join(TESTS_PATH, '../conf')],
            seats_per_game = 4,
            betting_structure = "level-10-20-no-limit"
        )

        for serial in xrange(1,5):
            self.failUnless(tourney.register(serial))

        self.assertEqual(len(tourney.games), 1)
        for game in tourney.games:
            for serial in game.serialsAll():
                game.botPlayer(serial)
        turn = 1
        running = True
        while running:
            turn += 1
            if turn >= 200: raise Exception('Suspecting infity loop (more than 200 turns were played).')
            for game in tourney.games:
                game.beginTurn(turn)
                tourney.removeBrokePlayers(game.id, now=True)
                if game.id in tourney.id2game and not tourney.tourneyEnd(game.id):
                    running = False 
                    break
コード例 #4
0
    def test1(self):
        tourney = PokerTournament(
            name = 'Test create',
            players_quota = 4,
            dirs = [path.join(TESTS_PATH, '../conf')],
            seats_per_game = 4,
            betting_structure = "level-10-20-no-limit"
        )

        for serial in xrange(1,5):
            self.failUnless(tourney.register(serial))

        self.assertEqual(len(tourney.games), 1)
        for game in tourney.games:
            for serial in game.serialsAll():
                game.botPlayer(serial)
        turn = 1
        running = True
        while running:
            turn += 1
            if turn >= 200: raise Exception('Suspecting infity loop (more than 200 turns were played).')
            for game in tourney.games:
                game.beginTurn(turn)
                tourney.removeBrokePlayers(game.id, now=True)
                if game.id in tourney.id2game and not tourney.tourneyEnd(game.id):
                    running = False 
                    break