Exemplo n.º 1
0
 def test_hand_add_card_new(self):
     """testing add card works"""
     prev_len = self.hand.num_cards()
     assert not self.hand.contains(card.Card('4', 'h'))
     self.hand.add_cards([card.Card('4', 'h')])
     assert self.hand.contains(card.Card('4', 'h'))
     assert self.hand.num_cards() == prev_len + 1
Exemplo n.º 2
0
 def test_hand_get_low_triple_double_invalid(self):
     """tests get low on invalid triple double"""
     c = card.Card('2', 'h')
     each_count = 3
     extra = 2
     low_card_play = self.hand_adj_trip.get_low(c, each_count, extra=extra)
     assert not low_card_play
Exemplo n.º 3
0
 def test_hand_get_low_wild_simple_valid(self):
     """tests get valid low wild"""
     c = card.Card('5', 'h')
     play = self.hand.get_low_wild(c)
     _check_quadruples(play.cards)
     assert play.get_base_card() > c
     _print_card_list(play, extra_msg="greater than {}".format(str(c)))
Exemplo n.º 4
0
 def test_hand_remove_card_invalid(self):
     """testing remove cards works"""
     prev_len = self.hand.num_cards()
     c = card.Card('3', 'h')
     assert not self.hand.contains(c)
     self.hand.remove_cards([c])
     assert self.hand.num_cards() == prev_len
Exemplo n.º 5
0
 def test_hand_add_card_dup(self):
     """testing add duiplicate card doesnt work"""
     prev_len = self.hand.num_cards()
     c = card.Card('7', 'h')
     assert self.hand.contains(c)
     self.hand.add_cards([c])
     assert self.hand.num_cards() == prev_len
Exemplo n.º 6
0
 def test_hand_get_low_double_valid(self):
     """tests get low on a valid double"""
     c = card.Card('3', 'h')
     each_count = 2
     play = self.hand.get_low(c, each_count)
     assert play.get_base_card() > c
     _check_double(play.cards)
     _print_card_list(play, extra_msg="greater than {}".format(str(c)))
Exemplo n.º 7
0
 def test_hand_get_low_adj_trip_double_valid(self):
     """tests get valid adj trip with 4 extras"""
     c = card.Card('4', 'h')
     play = self.hand_adj_trip.get_low_adj_triple(c, 4)
     assert play.num_cards() == 10
     assert play.get_base_card() > c
     _check_adj_triple(play.cards, 4)
     _print_card_list(play, extra_msg="greater than {}".format(str(c)))
Exemplo n.º 8
0
 def test_hand_get_low_triple_double_valid(self):
     """tests get low on a valid triple double"""
     c = card.Card('3', 'h')
     each_count = 3
     extra = 2
     play = self.hand_adj_trip.get_low(c, each_count, extra=extra)
     assert play.get_base_card() > c
     assert play.num_cards() == 5
     _check_triple(play.cards)
     _print_card_list(play, extra_msg="greater than {}".format(str(c)))
Exemplo n.º 9
0
 def test_hand_triple_straights_valid(self):
     """tests get valid low triple straight"""
     c = card.Card('4', 'h')
     each_count = 3
     length = 2
     play = self.hand_adj_trip.get_low_straight(c, each_count, length)
     _check_straight(play.cards, 3)
     assert play.num_cards() == length * each_count
     assert play.get_base_card() > c
     _print_card_list(play, extra_msg="greater than {}".format(str(c)))
Exemplo n.º 10
0
 def test_card_display_6(self):
     """Testing card displays"""
     assert str(card.Card(card.VALUES[3], card.SUITS[2])) == '♠6'
Exemplo n.º 11
0
 def test_card_is_gt(self):
     """Testing greater than"""
     assert card.Card('Z', 1) > card.Card('9', 'h')
Exemplo n.º 12
0
 def test_card_is_ge(self):
     """Testing greater than or equal"""
     assert card.Card('0', 'c') >= card.Card('9', 'h')
Exemplo n.º 13
0
 def test_card_is_eq(self):
     """Testing equals"""
     assert card.Card('6', 'c') == card.Card('6', 'c')
Exemplo n.º 14
0
 def test_card_is_le(self):
     """Testing less than or equal"""
     assert card.Card('9', 'c') <= card.Card('9', 'h')
Exemplo n.º 15
0
 def test_card_display_big_joker(self):
     """Testing if card recognizes big joker"""
     assert str(card.Card("Z", 1)) == 'JOKER'
Exemplo n.º 16
0
 def test_hand_get_low_double_invalid(self):
     """tests get low on invalid double"""
     c = card.Card('2', 'h')
     each_count = 2
     low_card_play = self.hand.get_low(c, each_count)
     assert not low_card_play
Exemplo n.º 17
0
 def test_hand_single_straights_invalid(self):
     """tests get invalid low single straight"""
     c = card.Card('5', 'h')
     each_count = 1
     length = 5
     assert not self.hand.get_low_straight(c, each_count, length)
Exemplo n.º 18
0
 def test_hand_get_low_wild_simple_invalid(self):
     """tests get invalid low wild"""
     c = card.Card('7', 'h')
     assert not self.hand.get_low_wild(c)
Exemplo n.º 19
0
 def test_hand_double_straights_invalid(self):
     """tests get invalid low double straight"""
     c = card.Card('0', 'h')
     each_count = 2
     length = 3
     assert not self.hand.get_low_straight(c, each_count, length)
Exemplo n.º 20
0
 def test_hand_get_cards(self):
     """testing that cards are retrieved properly"""
     assert self.hand.contains(card.Card('7', 'h'))
Exemplo n.º 21
0
 def test_card_display_Q(self):
     """Testing card displays"""
     assert str(card.Card(card.VALUES[9], card.SUITS[1])) == '♦Q'
Exemplo n.º 22
0
 def test_card_display_invalid_joker(self):
     """Testing if card recognizes invalid jokers"""
     assert str(card.Card("Z", card.SUITS[3])) == 'INVALID'
Exemplo n.º 23
0
 def test_card_is_royal_simple2(self):
     """Testing is royal"""
     assert not card.Card('0', card.SUITS[2]).is_royal()
Exemplo n.º 24
0
 def test_card_display_small_joker(self):
     """Testing if card recognizes big joker"""
     assert str(card.Card("Z", 0)) == 'joker'
Exemplo n.º 25
0
 def test_card_is_lt(self):
     """Testing less than"""
     assert card.Card('8', 'c') < card.Card('9', 'h')