예제 #1
0
def test_when_hands_have_same_card_values_then_correct_response_returned(
        hand_a, hand_b, expected):
    hand_a = get_hand(hand_a)
    hand_b = get_hand(hand_b)
    actual = hands_have_same_card_values(hand_a, hand_b)

    assert actual == expected
예제 #2
0
def test_when_get_all_combinations_then_correct_combinations_returned(
        hole_cards, board_cards, hand_size, expected_combos):
    hole_cards = get_hand(hole_cards)
    board_cards = get_hand(board_cards)
    expected_combos = get_hand_sets(expected_combos)

    combos = get_all_combinations(hole_cards, board_cards, hand_size)

    assert combos == expected_combos
예제 #3
0
def test_when_find_best_hand_then_correct_response_returned(
        hole_cards, board_cards, best_hand, hand_rank, hand_title,
        hand_description, solver_instance):
    hole_cards = get_hand(hole_cards)
    board_cards = get_hand(board_cards)
    expected_best_hand = get_hand(best_hand)

    actual_result = solver_instance.find_best_hand(hole_cards, board_cards)

    assert all(expected_card in actual_result["best_hand"]
               for expected_card in expected_best_hand)

    assert all(actual_card in expected_best_hand
               for actual_card in actual_result["best_hand"])

    assert hand_rank == actual_result["hand_rank"]
    assert hand_title == actual_result["hand_title"]
    assert hand_description == actual_result["hand_description"]
예제 #4
0
def test_when_describe_hand_and_texas_holdem_and_high_card_then_correct_description_returned(
        hand, expected):
    hand = get_hand(hand)
    actual = describe_hand("Texas Holdem", "High Card", hand=hand)
    assert actual == expected
예제 #5
0
def test_when_describe_hand_and_texas_holdem_and_two_pair_then_correct_description_returned(
        hand, expected):
    hand = get_hand(hand)
    actual = describe_hand("Texas Holdem", "Two Pair", hand=hand)
    assert actual == expected
예제 #6
0
def test_when_describe_hand_and_texas_holdem_and_straight_then_correct_description_returned(
        hand, expected):
    hand = get_hand(hand)
    actual = describe_hand("Texas Holdem", "Straight", hand=hand)
    assert actual == expected
예제 #7
0
def test_when_describe_hand_and_texas_holdem_and_full_house_then_correct_description_returned(
        hand, expected):
    hand = get_hand(hand)
    actual = describe_hand("Texas Holdem", "Full House", hand=hand)
    assert actual == expected
예제 #8
0
def test_when_hand_test_and_texas_holdem_and_high_card_then_correct_response_returned(
        hand_name, expected):
    actual = hand_test("Texas Holdem", "High Card", hand=get_hand(hand_name))
    assert actual == expected
예제 #9
0
def test_when_hand_test_then_correct_response_returned(hand_name, expected):
    actual = hand_test("Texas Holdem", "Two Pair", hand=get_hand(hand_name))
    assert actual == expected
예제 #10
0
def test_when_hand_test_and_texas_holdem_and_straight_then_correct_response_returned(
        hand_name, expected):
    actual = hand_test("Texas Holdem", "Straight", hand=get_hand(hand_name))
    assert actual == expected
예제 #11
0
def test_when_hand_test_and_texas_holdem_and_full_house_then_correct_response_returned(
        hand_name, expected):
    actual = hand_test("Texas Holdem", "Full House", hand=get_hand(hand_name))
    assert actual == expected
예제 #12
0
def test_when_hand_test_then_correct_response_returned(game_type, hand_type,
                                                       hand_name, expected):
    actual = hand_test(game_type, hand_type, hand=get_hand(hand_name))
    assert actual == expected
예제 #13
0
def test_when_hand_all_same_suit_then_correct_response_returned(
        hand, expected):
    hand = get_hand(hand)
    actual = hand_all_same_suit(hand)
    assert actual == expected
예제 #14
0
def test_when_hand_is_ace_low_straight_then_correct_response_returned(
        hand_name, expected):
    hand = get_hand(hand_name)
    actual = hand_is_ace_low_straight(hand)
    assert actual == expected
예제 #15
0
def test_when_hand_has_value_tuple_then_correct_response_returned(
        hand_name, tuple_length, expected_tuple_value):
    hand = get_hand(hand_name)
    tuple_value = hand_highest_value_tuple(hand, tuple_length)
    assert tuple_value == expected_tuple_value
예제 #16
0
def test_when_hand_values_continuous_then_correct_response_returned(
        hand, expected):
    hand = get_hand(hand)
    actual = hand_values_continuous(hand)
    assert actual == expected