Esempio n. 1
0
    def test_four_of_kind(self):
        print("\tTESTING four of a kind...")

        hand = json.loads( '["7H", "7C", "7S", "5C", "7H"]' )
        assert one(hand) == {'name': 'Four of a Kind', 'hand': ['7H', '7C', '7S', '5C', '7H'], 'value': None, 'kicker': 5}

        hand = json.loads( '["KH", "KC", "KS", "AC", "KH"]' )
        assert one(hand) == {'name': 'Four of a Kind', 'hand': ['KH', 'KC', 'KS', 'AC', 'KH'], 'value': None, 'kicker': 'A'}
Esempio n. 2
0
    def test_highest(self):
        print("\tTESTING highest card...")

        hand = json.loads( '["JH", "4C", "5S", "KC", "9H"]' )
        assert one(hand) == {'name': 'High Card', 'hand': ['JH', '4C', '5S', 'KC', '9H'], 'value': 'K', 'kicker': None}

        hand = json.loads( '["9H", "4C", "5S", "8C", "3S"]' )
        assert one(hand) == {'name': 'High Card', 'hand': ['9H', '4C', '5S', '8C', '3S'], 'value': 9, 'kicker': None}
Esempio n. 3
0
    def test_mixed_straight(self):
        print("\tTESTING mixed numeric and non-numeric straights...")

        hand = json.loads( '["AH", "KH", "QD", "JC", "10C"]' )
        assert one(hand) == {'name': 'Straight', 'hand': ['AH', 'KH', 'QD', 'JC', '10C'], 'value': None, 'kicker': None}

        hand = json.loads( '["KH", "QD", "JC", "10C", "9C"]' )
        assert one(hand) == {'name': 'Straight', 'hand': ['KH', 'QD', 'JC', '10C', '9C'], 'value': None, 'kicker': None}
Esempio n. 4
0
    def test_straight_flush(self):
        print("\tTESTING straight flush...")

        hand = json.loads( '["8C", "7C", "6C", "5C", "4C"]' )
        assert one(hand) == {'name': 'Straight Flush', 'hand': ['8C', '7C', '6C', '5C', '4C'], 'value': None, 'kicker': None}

        hand = json.loads( '["7S", "5S", "6S", "8S", "4S"]' )
        assert one(hand) == {"name": "Straight Flush", "hand": ['7S', '5S', '6S', '8S', '4S'], "value": None, "kicker": None}
Esempio n. 5
0
    def test_one_pair(self):
        print("\tTESTING one pair...")

        hand = json.loads( '["JH", "4C", "5S", "JC", "9H"]' )
        assert one(hand) == {'name': 'One Pair', 'hand': ['JH', '4C', '5S', 'JC', '9H'], 'value': None, 'kicker': 9}
Esempio n. 6
0
    def test_two_pair(self):
        print("\tTESTING two pair...")

        hand = json.loads( '["JH", "4C", "4S", "JC", "9H"]' )
        assert one(hand) == {'name': 'Two Pair', 'hand': ['JH', '4C', '4S', 'JC', '9H'], 'value': None, 'kicker': 'J'}
Esempio n. 7
0
    def test_three_of_kind(self):
        print("\tTESTING three fo a kind...")

        hand = json.loads( '["7H", "7C", "5S", "JC", "7H"]' )
        assert one(hand) == {'name': 'Three of a Kind', 'hand': ['7H', '7C', '5S', 'JC', '7H'], 'value': None, 'kicker': 'J'}
Esempio n. 8
0
    def test_straight(self):
        print("\tTESTING straights...")

        hand = json.loads( '["7H", "5H", "6C", "8C", "4C"]' )
        assert one(hand) == {'name': 'Straight', 'hand': ['7H', '5H', '6C', '8C', '4C'], 'value': None, 'kicker': None}
Esempio n. 9
0
    def test_flush(self):
        print("\tTESTING flush...")

        hand = json.loads( '["9C", "7C", "5C", "6C", "10C"]' )
        assert one(hand) == {'name': 'Flush', 'hand': ['9C', '7C', '5C', '6C', '10C'], 'value': None, 'kicker': None}
Esempio n. 10
0
    def test_full_house(self):
        print("\tTESTING full house...")

        hand = json.loads( '["7H", "7C", "5S", "5C", "7H"]' )
        assert one(hand) == {'name': 'Full House', 'hand': ['7H', '7C', '5S', '5C', '7H'], 'value': None, 'kicker': None}
Esempio n. 11
0
    def test_royal_flush(self):
        print("\tTESTING royal flush...")

        hand = json.loads( '["AC", "KC", "QC", "JC", "10C"]' )
        assert one(hand) == {'name': 'Royal Flush', 'hand': ['AC', 'KC', 'QC', 'JC', '10C'], 'value': None, 'kicker': None}