-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tests.py
28 lines (24 loc) · 815 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
from Hand import Hand
from Card import Card
from Game import Game
import datetime
def test_game(hole_ranks, hole_suits, comm_ranks, comm_suits):
start = datetime.datetime.now()
hole = set()
community = set()
for i in range(2):
hole.add(Card(hole_ranks[i], hole_suits[i]))
for i in range(len(comm_ranks)):
community.add(Card(comm_ranks[i], comm_suits[i]))
game = Game()
result = game.compute(hole, community)
print(datetime.datetime.now() - start)
print(result)
def test_hand(ranks, suits):
cards = []
for i in range(len(ranks)):
cards.append(Card(ranks[i], suits[i]))
print(Hand(cards))
if __name__ == '__main__':
test_game([13,14],['h', 'c'],[11,10,8],['h','s','d'])
# test_hand([9,8,10,3,5,13,14], ['h','s','d','c','s','d','s'])