예제 #1
0
 def test_parity_outcomes(self):
     """Check that Even/Odd Outcomes are assigned correctly to TempBins."""
     self.bin_builder.prepare_parity_outcomes()
     even = EvenMoney("Even")
     odd = EvenMoney("Odd")
     expectations = []
     expectations.extend([[i, even] for i in [2, 4, 10, 20, 24, 36]])
     expectations.extend([[i, odd] for i in [1, 3, 13, 15, 29, 35]])
     self.check_bins(expectations)
예제 #2
0
파일: bin_test.py 프로젝트: stanl3y/vegas
    def setUp(self):
        self.straight1 = Straight(1)
        self.straight2 = Straight(2)
        self.red = EvenMoney("Red")
        self.black = EvenMoney("Black")
        self.corner_bet = Corner(1)

        self.bin1 = Bin({self.straight1, self.red, self.corner_bet})
        self.bin2 = Bin({self.straight2, self.black, self.corner_bet})
예제 #3
0
 def test_colour_outcomes(self):
     """Check that Red/Black Outcomes are assigned correctly to TempBins."""
     self.bin_builder.prepare_colour_outcomes()
     red = EvenMoney("Red")
     black = EvenMoney("Black")
     expectations = []
     expectations.extend([[i, red] for i in [1, 7, 14, 19, 27, 36]])
     expectations.extend([[j, black] for j in [2, 4, 11, 15, 22, 29, 35]])
     self.check_bins(expectations)
예제 #4
0
 def test_range_outcomes(self):
     """Check that Low/High Outcomes are assigned correctly to TempBins."""
     self.bin_builder.prepare_range_outcomes()
     low = EvenMoney("Low")
     high = EvenMoney("High")
     expectations = []
     expectations.extend([(i, low) for i in (1, 2, 7, 11, 15, 18)])
     expectations.extend([(j, high) for j in (19, 20, 25, 32, 33, 36)])
     self.check_bins(expectations)
예제 #5
0
 def setUp(self):
   self.bet = Bet(1, EvenMoney("Black"))
   self.mock_player = Mock()
   self.table = Table(0, 1)
   self.mock_wheel = Mock()
   self.mock_wheel.next.return_value = set()
   self.game = Game(self.table, self.mock_wheel)
예제 #6
0
파일: table_test.py 프로젝트: stanl3y/vegas
 def test_table_isValid_total_table_limit(self):
   """Sum of all Bets should be less or equal to the Table limit."""
   table = Table(0, 10)
   # invalid Bet (total table bets more than limit)
   table.placeBet(Bet(11, EvenMoney("High")))
   self.assertRaises(InvalidBet, table.isValid)
예제 #7
0
파일: table_test.py 프로젝트: stanl3y/vegas
 def test_table_isValid_minimum_bet_amount(self):
   """Each Bet should be greater or equal to the Table minimum."""
   table = Table(10, 1000)
   # invalid Bet (amountBet less than Table minimum)
   table.placeBet(Bet(1, EvenMoney("Black")))
   self.assertRaises(InvalidBet, table.isValid)
예제 #8
0
파일: table_test.py 프로젝트: stanl3y/vegas
 def test_table_isValid_valid_table(self):
   """A valid Table should be a valid."""
   table = Table(1, 10)
   table.placeBet(Bet(1, EvenMoney("Red")))
   table.placeBet(Bet(2, EvenMoney("Black")))
   self.assertTrue(table.isValid())
예제 #9
0
파일: table_test.py 프로젝트: stanl3y/vegas
 def table_with_bets(self):
   """Prepare a Table a with some Bets on it."""
   self.table.placeBet(Bet(4, Split(1, 4)))
   self.table.placeBet(Bet(6, EvenMoney("High")))
   return self.table
예제 #10
0
파일: table_test.py 프로젝트: stanl3y/vegas
 def setUp(self):
   self.outcome = EvenMoney("Red")
   self.table = Table(0, 10)
예제 #11
0
 def test_outcome_mapping(self):
   """Integration test for BinBuilder: strinng to Outcome mapping."""
   sample_outcomes = [Straight(1), Street(16), EvenMoney("Red")]
   for outcome in sample_outcomes:
     self.assertEqual(outcome, self.wheel.getOutcome(outcome.name))
예제 #12
0
 def setUp(self):
     self.outcome = EvenMoney("Red")
     self.amount = 5
     self.bet = Bet(self.amount, self.outcome)
예제 #13
0
 def test_even_money_init(self):
     """Check the constructor of EvenMoney-bet Outcome."""
     even_money = EvenMoney("Red")
     self.assertEqual(even_money.name, "Red")
     self.assertEqual(even_money.odds, 1)