コード例 #1
0
def test_is_pair_or_better():
    assert is_pair_or_better(hand('Ad Ac 7s 6s 5s'))
    assert is_pair_or_better(hand('Ad Ac Kd Kc 2h'))
    assert is_pair_or_better(hand('Ad Ac As 6c 5c'))
    assert is_pair_or_better(hand('Ad Kh Qs Jc Td'))
    assert is_pair_or_better(hand('Ad 8d 7d 6d 5d'))
    assert is_pair_or_better(hand('Ad Ac As 5d 5c'))
    assert is_pair_or_better(hand('Ad Ac As Ah 5c'))
    assert is_pair_or_better(hand('Ad Kd Qd Jd Td'))
    assert not is_pair_or_better(hand('Ad Kd Qd Jd 3c'))
    assert not is_pair_or_better(hand('Ts 9s 7c 6s 5s'))
コード例 #2
0
def test_is_onepair():
    assert is_onepair(hand('4h 4d 5s 6h 7d'))
    assert is_onepair(hand('Ac As 2h Qc Ks'))
    assert not is_onepair(hand('4h 4d 4s 7h 8h'))
    assert not is_onepair(hand('Ad 2s 3h 4c 6d'))
コード例 #3
0
def test_is_nopair():
    assert is_nopair(hand('4h 7d 9s Jh Ad'))
    assert is_nopair(hand('Ac 2s 3h 4c 6s'))
    assert not is_nopair(hand('4h 4d 4s 7h 8h'))
    assert not is_nopair(hand('As Ks Qs Js Ts'))
コード例 #4
0
def test_is_threeofakind():
    assert is_threeofakind(hand('4h 4d 4s 5h 6d'))
    assert is_threeofakind(hand('Ac As Ah 2c Ks'))
    assert not is_threeofakind(hand('4h 4d 7s 7h 8h'))
    assert not is_threeofakind(hand('Ad 2s 3s 4s 5s'))
コード例 #5
0
def test_is_twopair():
    assert is_twopair(hand('4h 4d 5s 5h 6d'))
    assert is_twopair(hand('Ac As 2h 2c Ks'))
    assert not is_twopair(hand('4h 4d 5s 7h 8h'))
    assert not is_twopair(hand('Ad As 2h Qc Kd'))
コード例 #6
0
def test_is_straight():
    assert is_straight(hand('4h 5d 6s 7h 8d'))
    assert is_straight(hand('Ac 2s 3h 4c 5s'))
    assert is_straight(hand('Tc Js Qh Kc As'))
    assert not is_straight(hand('4h 5d 6s 7h 9h'))
    assert not is_straight(hand('Ad 2s 3h 4c 6d'))
コード例 #7
0
def test_is_flush():
    assert is_flush(hand('4d 5d 8d Jd Qd'))
    assert is_flush(hand('Ac 8c 7c 5c 2c'))
    assert not is_flush(hand('4h 4s 5s 7s 8s'))
    assert not is_flush(hand('Ad 7d 6d 3d 2h'))
コード例 #8
0
def test_is_fullhouse():
    assert is_fullhouse(hand('4h 4d 4s 5h 5d'))
    assert is_fullhouse(hand('Ac As Ah 2c 2s'))
    assert not is_fullhouse(hand('4h 4d 4s 7h 8h'))
    assert not is_fullhouse(hand('Ad As Ah 2c Kd'))
コード例 #9
0
def test_is_fourofakind():
    assert is_fourofakind(hand('4h 4d 4s 4c Ac'))
    assert is_fourofakind(hand('Ac As Ah Ad 2d'))
    assert not is_fourofakind(hand('4c 5h 6h 7h 8h'))
    assert not is_fourofakind(hand('Ad Ks Qs Js Ts'))
コード例 #10
0
def test_is_straightflush():
    assert is_straightflush(hand('4h 5h 6h 7h 8h'))
    assert is_straightflush(hand('As Ks Qs Js Ts'))
    assert not is_straightflush(hand('4c 5h 6h 7h 8h'))
    assert not is_straightflush(hand('Ad Ks Qs Js Ts'))