def assert_correct(hand_1, hand_2, value): actual_value = compare_hands(hand_1, hand_2) try: assert actual_value == value except: print 'Test failed!' print ' Hand 1: ', hand_1 print ' classification: ', hand_evaluation.classify_hand([game_simulator.string_to_card(x) for x in hand_1]) print ' Hand 2: ', hand_2 print ' classification: ', hand_evaluation.classify_hand([game_simulator.string_to_card(x) for x in hand_2]) print ' Should have been: ' , value print ' Instead was : ' , actual_value print
def compare_hands(handA, handB): handA = [game_simulator.string_to_card(x) for x in handA] handB = [game_simulator.string_to_card(x) for x in handB] return hand_evaluation.poker_hand_comparator(handA, handB)