-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtests.py
33 lines (24 loc) · 935 Bytes
/
tests.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from unittest import TestCase
from scoring import Scorer
#imports from scoring
import pyCardDeck
# noinspection PyCompatibility
from typing import List
from pyCardDeck.cards import PokerCard
from collections import OrderedDict
class TestScoring(TestCase):
def testHighCard(self):
# Create hand and community cards
hand = []
field = []
hand.append(PokerCard("Hearts", "9", "Nine"))
hand.append(PokerCard("Hearts", "10", "Ten"))
field.append(PokerCard("Spades", "9", "Nine"))
field.append(PokerCard("Spades", "K", "King"))
field.append(PokerCard("Spades", "A", "Ace"))
field.append(PokerCard("Spades", "2", "2"))
field.append(PokerCard("Spades", "10", "Ten"))
# Init scorer
scorer = Scorer(hand, field)
result = scorer.high_card_search()
self.assertEqual(result['cards'], PokerCard("Spades", "A", "Ace"))