def test_bet_1(self): players = [LearningPlayer('v1')] * 3 game = LandlordGame(players=players) game.play_move(BetMove(0)) game.play_move(BetMove(0)) self.assertFalse(game.is_round_over()) self.assertFalse(game.is_betting_complete()) self.assertFalse(game.move_ends_game(BetMove(1))) self.assertTrue(game.move_ends_game(BetMove(0))) game.play_move(BetMove(0)) self.assertTrue(game.is_round_over()) self.assertTrue(game.is_betting_complete())
def test_landlord_game_ending(self): players = [LearningPlayer('v1')] * 3 game = LandlordGame(players=players) hands = { TurnPosition.FIRST: [Card.ACE] * 4, TurnPosition.SECOND: [Card.TEN] * 4, TurnPosition.THIRD: [Card.FIVE] * 4 } game._betting_complete = True game.force_setup(TurnPosition.THIRD, hands, 2) self.assertTrue( game.move_ends_game( SpecificMove(RankedMoveType(MoveType.BOMB, Card.FIVE), Counter({Card.FIVE: 4})))) self.assertFalse( game.move_ends_game( SpecificMove(RankedMoveType(MoveType.BOMB, Card.TEN), Counter({Card.TEN: 4}))))