Exemplo n.º 1
0
 def test_draw_condition(self):
     player_one = Hand('9S 9H 9C 9D TC')     # (9,9,9,9)  => same value
     player_two = Hand('9S 9H 9C 9D TC')     # (9,9,9,9)  => same value
     self.assertTrue(
         player_one.rank == player_two.rank and
         player_one.get_points() == player_two.get_points()
     )
Exemplo n.º 2
0
 def test_winner_incase_of_one_pair_hands(self):
     player_one = Hand('5H 5C 6S 7S KD')  # 5, 5
     player_two = Hand(
         '2C 3S 8S 8D TD'
     )  # 8, 8 => This hand has High Points as per Poker Rules
     self.assertTrue(player_one.rank == player_two.rank
                     and player_two.get_points() > player_one.get_points())
Exemplo n.º 3
0
 def test_winner_incase_of_four_of_a_kind(self):
     player_one = Hand('9S 9H 9C 9D TC')    # (9,9,9,9) => has high points
     player_two = Hand('3S 3H 3C 3D TC')    # (3,3,3,3)
     self.assertTrue(
         player_one.rank == player_two.rank and
         player_one.get_points() > player_two.get_points()
     )
Exemplo n.º 4
0
 def test_winner_incase_of_full_house(self):
     player_one = Hand('KH KC KD TC TD')    #(K, K, K)  => has high points
     player_two = Hand('QH QC QD TC TD')    #(Q, Q, Q)
     self.assertTrue(
         player_one.rank == player_two.rank and
         player_one.get_points() > player_two.get_points()
     )
Exemplo n.º 5
0
 def test_winner_incase_of_three_of_a_kind(self):
     player_one = Hand('8S 8D 8C 2H 5C')    #(8, 8, 8) => has high value
     player_two = Hand('AS AD AC 2H 5C')    #(A, A, A)
     self.assertTrue(
         player_one.rank == player_two.rank and
         player_one.get_points() > player_two.get_points()
     )
Exemplo n.º 6
0
 def test_winner_incase_of_two_pair_harnds(self):
     player_one = Hand('9D 9H 6C 8S 8C')  # (9, 9),(8, 8) => has high points
     player_two = Hand('2D 2H 6C 8S 8C')  # (2, 2),(8, 8)
     self.assertTrue(
         player_one.rank == player_two.rank and
         player_two.get_points() < player_one.get_points()
     )
Exemplo n.º 7
0
 def test_winner_incase_of_one_pair_hands(self):
     player_one = Hand('5H 5C 6S 7S KD')    # 5, 5
     player_two = Hand('2C 3S 8S 8D TD')    # 8, 8 => This hand has High Points as per Poker Rules
     self.assertTrue(
         player_one.rank == player_two.rank and
         player_two.get_points() > player_one.get_points()
     )
Exemplo n.º 8
0
 def test_draw_condition(self):
     player_one = Hand('9S 9H 9C 9D TC')  # (9,9,9,9)  => same value
     player_two = Hand('9S 9H 9C 9D TC')  # (9,9,9,9)  => same value
     self.assertTrue(player_one.rank == player_two.rank
                     and player_one.get_points() == player_two.get_points())
Exemplo n.º 9
0
 def test_winner_incase_of_four_of_a_kind(self):
     player_one = Hand('9S 9H 9C 9D TC')  # (9,9,9,9) => has high points
     player_two = Hand('3S 3H 3C 3D TC')  # (3,3,3,3)
     self.assertTrue(player_one.rank == player_two.rank
                     and player_one.get_points() > player_two.get_points())
Exemplo n.º 10
0
 def test_winner_incase_of_full_house(self):
     player_one = Hand('KH KC KD TC TD')  #(K, K, K)  => has high points
     player_two = Hand('QH QC QD TC TD')  #(Q, Q, Q)
     self.assertTrue(player_one.rank == player_two.rank
                     and player_one.get_points() > player_two.get_points())
Exemplo n.º 11
0
 def test_winner_incase_of_three_of_a_kind(self):
     player_one = Hand('8S 8D 8C 2H 5C')  #(8, 8, 8) => has high value
     player_two = Hand('AS AD AC 2H 5C')  #(A, A, A)
     self.assertTrue(player_one.rank == player_two.rank
                     and player_one.get_points() > player_two.get_points())
Exemplo n.º 12
0
 def test_winner_incase_of_two_pair_harnds(self):
     player_one = Hand('9D 9H 6C 8S 8C')  # (9, 9),(8, 8) => has high points
     player_two = Hand('2D 2H 6C 8S 8C')  # (2, 2),(8, 8)
     self.assertTrue(player_one.rank == player_two.rank
                     and player_two.get_points() < player_one.get_points())