def test_win(self):
        self.player.win(bet.Bet(amount=10, outcome=self.line_outcome))
        test_bet = self.player.line_strategy.createBet(self.player)
        self.assertEqual(test_bet.amount, self.strategy_nochange.bet_amount)

        self.player.win(bet.Bet(amount=10, outcome=self.odds_outcome))
        self.assertEqual(self.player.odds_strategy.loss_count, 0)
        test_bet = self.player.odds_strategy.createBet(self.player)
        self.assertEqual(test_bet.amount, self.strategy_martingale.bet_amount)
 def setUp(self):
     self.table = table.Table(minimum=1, maximum=450)
     self.dice = dice.Dice()
     self.game = craps_game.CrapsGame(self.dice,self.table)
     self.bets = [
         bet.Bet(5, outcome.Outcome("Pass Line", 1)),
         bet.Bet(10, outcome.Outcome("Any Craps", 31)),
         bet.Bet(50, outcome.Outcome("Odds on Come", 16)),
         bet.Bet(490, outcome.Outcome("Dont Pass Line", 2))
     ]
 def setUp(self):
     self.wheel = wheel.Wheel()
     self.table = table.Table(minimum=1, maximum=1000)
     self.game = roulette_game.RouletteGame(table=self.table,
                                            wheel=self.wheel)
     self.bets = [
         bet.Bet(5, outcome.Outcome("Number 1", 35)),
         bet.Bet(20, outcome.Outcome("Number 2", 35)),
         bet.Bet(50, outcome.Outcome("Number 3", 35)),
         bet.Bet(490, outcome.Outcome("Number 4", 35))
     ]
    def test_lose(self):
        self.player.lose(bet.Bet(10, self.line_outcome))
        test_bet = self.player.line_strategy.createBet(self.player)
        self.assertEqual(test_bet.amount, 10)

        self.player.lose(bet.Bet(10, self.odds_outcome))
        test_bet = self.player.odds_strategy.createBet(self.player)
        self.assertEqual(test_bet.amount, self.player.odds_strategy.bet_amount)

        self.player.lose(bet.Bet(10, self.seven_outcome))
        test_bet = self.player.seven_strategy.createBet(self.player)
        self.assertEqual(test_bet.amount,
                         2 * self.player.odds_strategy.bet_amount)
    def test_lose(self):
        self.player.lose(bet.Bet(amount=10, outcome=self.outcome))
        self.assertEqual(self.player.line_strategy.loss_count, 1)
        test_bet = self.player.line_strategy.createBet(self.player)
        self.assertEqual(
            test_bet.amount,
            # self.strategy_martingale.bet_amount
            self.strategy_martingale.bet_amount * 2)

        self.player.win(bet.Bet(amount=10, outcome=self.outcome))
        self.assertEqual(self.player.line_strategy.loss_count, 0)
        test_bet = self.player.line_strategy.createBet(self.player)
        self.assertEqual(test_bet.amount, self.strategy_martingale.bet_amount)
 def setUp(self):
     self.bet = bet.Bet(10, outcome.Outcome('Number 0', 35), None)
     self.bet_commission_buy = bet.CommissionBet(20,
                                                 outcome.Outcome('Buy', 2),
                                                 None)
     self.bet_commission_lay = bet.CommissionBet(
         30, outcome.Outcome('Lay', 2 / 3), None)
示例#7
0
 def test_win(self):
     self.assertEqual(self.player.current, 1)
     self.assertEqual(self.player.previous, 0)
     self.player.win(
         bet.Bet(outcome=self.wheel.all_outcomes.get('Black'),
                 amount=self.player.current))
     self.assertEqual(self.player.current, 1)
     self.assertEqual(self.player.previous, 0)
 def setUp(self):
     self.wheel = wheel.Wheel()
     self.table = table.Table(minimum=1, maximum=1000)
     self.game = roulette_game.RouletteGame(table=self.table,
                                            wheel=self.wheel)
     self.player = roulette1326.Roulette1326(wheel=self.wheel,
                                             table=self.table)
     self.bet = bet.Bet(outcome=self.wheel.all_outcomes.get('Black'),
                        amount=10)
 def test_win(self):
     self.assertEqual(len(self.player.sequence), 6)
     if len(self.player.sequence) == 1:
         bet_amount = self.player.sequence[0]
     elif len(self.player.sequence) > 1:
         bet_amount = self.player.sequence[0] + self.player.sequence[-1]
     self.player.win(
         bet.Bet(outcome=self.wheel.all_outcomes.get('Black'),
                 amount=bet_amount))
     self.assertEqual(len(self.player.sequence), 4)
     self.assertEqual(len(self.player.sequence), 4)
 def test_placeBets(self):
     self.player.placeBets(0, self.game)
     self.game.state = craps_game_state.CrapsGamePointOn(game=self.game,
                                                         point=5)
     self.player.placeBets(5, self.game)
     self.assertEqual(len(self.game.table.bets), 2)
     for multiplier in [1, 3, 2, 6]:
         self.player.placeBets(5, self.game)
         test_bet = self.player.odds_strategy.createBet(self.player)
         self.assertEqual(test_bet.amount,
                          multiplier * self.player.odds_strategy.bet_amount)
         self.player.win(bet.Bet(10, self.odds_outcome))
     self.assertEqual(len(self.game.table.bets), 2)
     for _ in range(3):
         self.player.placeBets(5, self.game)
     self.assertEqual(len(self.game.table.bets), 3)
     self.assertEqual(self.game.table.bets[2].outcome, self.seven_outcome)
示例#11
0
 def toBet(self, match):
     odds = self.isInFavour(match)
     if odds != None:
         return b.Bet(odds, match)
     return None