def test_copy_player(self): test_deck_path = os.path.join("..", "decks", "testdeckold.json") p = Player("dude", test_deck_path, 5) p_copy = p.get_copy() #top card of test deck is 100 tribbles rescue self.assertEqual(p_copy.deck.deck[0].denomination, 100) self.assertEqual(p_copy.deck.deck[0].power, Power.Rescue) #draw that card p_copy.action_draw_card() #only card in hand should be that card self.assertEqual(p_copy.hand.deck[0].denomination, 100) self.assertEqual(p_copy.hand.deck[0].power, Power.Rescue)
def test_player_copy(self): test_deck_path = os.path.join("..", "decks", "testdeckold.json") p = Player("dude", test_deck_path, 5) pcopy = p.get_copy() # what is the top card of the deck? top_card_of_deck = pcopy.deck.deck[0] # do the draw pcopy.action_draw_card() # play card in hand pcopy.action_play_card(pcopy.hand.deck[0]) # hand should be empty self.assertEqual(len(pcopy.hand.deck), 0) # play pile should be one card in length self.assertEqual(len(pcopy.play_pile.deck), 1) # only card in play pile should be the same card as top_card_of_deck from before self.assertEqual(pcopy.play_pile.get_top_card_and_remove_card(), top_card_of_deck)