Example #1
0
 def test_remove_raises_if_count_less_than_1(self):
     player = Player()
     player_hand = PlayerHand(player=player)
     with pytest.raises(
         RuntimeError, match="Cannot remove 0 or less cards from the hand."
     ):
         player_hand.remove(resource_type=Clay, count=0)
Example #2
0
 def test_remove_has_less_than_x_of_resource_type(self):
     player = Player()
     player_hand = PlayerHand(player=player)
     player_hand.hand[Clay] = 2
     removed_count = player_hand.remove(resource_type=Clay, count=3)
     assert removed_count == 2
     assert player_hand.hand[Clay] == 0
Example #3
0
 def test_remove_has_at_least_x_of_resource_type(self):
     player = Player()
     player_hand = PlayerHand(player=player)
     player_hand.hand[Clay] = 2
     removed_count = player_hand.remove(resource_type=Clay, count=1)
     assert removed_count == 1
     assert player_hand.hand[Clay] == 1