def testNewCards(self):
        """Confirm newCards adds cards to hand"""
        test_state = ClientState(ruleset=None)
        wholeDeck = Card.getStandardDeck()
        test_state.newCards(wholeDeck)
        self.assertEqual(wholeDeck, test_state.hand_cards)

        drawn_cards = [Card(0, None), Card(0, None)]
        test_state.newCards(drawn_cards)
        self.assertEqual(Card.getJokerDeck(), test_state.hand_cards)
    def testDiscardCards(self):
        """Confirm discardCards removes cards without playing them"""
        test_state = ClientState(ruleset=None)
        hand = [
            Card(1, 'Spades'),
            Card(2, 'Clubs'),
            Card(3, 'Diamonds'),
            Card(4, 'Hearts'),
            Card(0, None)
        ]
        test_state.newCards(hand)
        test_state.discardCards([Card(1, 'Spades')])
        self.assertEqual(test_state.played_cards, {})
        hand.remove(Card(1, 'Spades'))
        self.assertEqual(test_state.hand_cards, hand)

        #Confirm can only discard cards actually in your hand
        with self.assertRaises(Exception):
            test_state.discardCards([Card(1, 'Spades')])

        #Confirm can only discard correct number of cards
        with self.assertRaises(Exception):
            test_state.discardCards([Card(2, 'Clubs'), Card(3, 'Diamonds')])
    def testPlayCards(self):
        """Confirm playCards transfers cards from hand to visible"""
        test_state = ClientState(ruleset=None)
        hand = [
            Card(1, 'Spades'),
            Card(2, 'Clubs'),
            Card(3, 'Diamonds'),
            Card(4, 'Hearts'),
            Card(4, 'Spades'),
            Card(0, None)
        ]
        test_state.newCards(hand)
        self.assertEqual(test_state.hand_cards, hand)

        #Confirm can't play cards we don't have (even if we have some)
        with self.assertRaises(Exception):
            test_state.playCards(
                {1: [Card(1, 'Spades'),
                     Card(1, 'Spades'),
                     Card(0, None)]})
        #Confirm failed play didn't edit hand
        self.assertEqual(test_state.hand_cards, hand)

        #Confirm can't play illegal move
        with self.assertRaises(Exception):
            test_state.playCards({1: [Card(1, 'Spades')]})
        #Confirm failed play didn't edit hand
        self.assertEqual(test_state.hand_cards, hand)

        #Confirm legal play is allowed and edits played cards and hand properly
        test_state.newCards([Card(1, 'Spades'), Card(0, None)])
        test_state.playCards(
            {1: [Card(1, 'Spades'),
                 Card(1, 'Spades'),
                 Card(0, None)]})
        self.assertEqual(
            test_state.played_cards,
            {1: [Card(1, 'Spades'),
                 Card(1, 'Spades'),
                 Card(0, None)]})
        hand.remove(Card(1, 'Spades'))
        self.assertEqual(test_state.hand_cards, hand)

        #Confirm second play adds to the played cards properly
        test_state.playCards(
            {4: [Card(4, 'Hearts'),
                 Card(4, 'Spades'),
                 Card(2, 'Clubs')]})
        self.assertEqual(
            test_state.played_cards, {
                1: [Card(1, 'Spades'),
                    Card(1, 'Spades'),
                    Card(0, None)],
                4: [Card(4, 'Hearts'),
                    Card(4, 'Spades'),
                    Card(2, 'Clubs')]
            })
        hand.remove(Card(4, 'Hearts'))
        hand.remove(Card(4, 'Spades'))
        hand.remove(Card(2, 'Clubs'))
        self.assertEqual(
            test_state.hand_cards,
            [Card(3, 'Diamonds'), Card(0, None)])