예제 #1
0
파일: test_range.py 프로젝트: lmacken/poker
 def test_pairs_from_hands(self):
     assert Range.from_objects({Hand('AA'), Hand('KK'), Hand('QQ')}) == Range('QQ+')
예제 #2
0
 def test_pairs_with_dash_are_equal_with_spaces(self):
     assert Range('22-33').combos == Range('22 33').combos
     assert Range('55-33').combos == Range('33 44 55').combos
예제 #3
0
 def test_offsuit(self):
     assert Range('AkO') == Range('AKo')
예제 #4
0
    def test_empty_range(self):
        assert Range().hands == tuple()
        assert Range().combos == tuple()

        assert Range('').hands == tuple()
        assert Range('').combos == tuple()
예제 #5
0
 def test_pairs_multiple(self):
     assert Range('22 33').combos == DEUCE_COMBOS + THREE_COMBOS
예제 #6
0
 def test_suited_plus(self):
     assert Range('KJs+').hands == (Hand('KJs'), Hand('KQs'))
예제 #7
0
 def test_offsuit_and_suited_dashed(self):
     assert Range('J8-J4').hands == (Hand('J4o'), Hand('J4s'), Hand('J5o'),
                                     Hand('J5s'), Hand('J6o'), Hand('J6s'),
                                     Hand('J7o'), Hand('J7s'), Hand('J8o'),
                                     Hand('J8s'))
예제 #8
0
def test_pickable():
    assert pickle.loads(pickle.dumps(Range('Ako 22+'))) == Range('AKo 22+')
예제 #9
0
 def test_pairs_with_dash_reverse(self):
     assert Range('55-22').hands == (Hand('22'), Hand('33'), Hand('44'), Hand('55'))
     assert Range('33-22').hands == (Hand('22'), Hand('33'))
예제 #10
0
 def test_wrong_str_in_range_raises_ValueError(self):
     with pytest.raises(ValueError):
         assert 'AKl' in Range('AQo+')
예제 #11
0
 def test_pairs_with_dash(self):
     assert Range('22-55').hands == (Hand('22'), Hand('33'), Hand('44'), Hand('55'))
     assert Range('22-33').hands == (Hand('22'), Hand('33'))
예제 #12
0
 def test_str_in_range(self):
     assert 'AKo' in Range('AQo+')
예제 #13
0
 def test_hand_in_range(self):
     assert Hand('Ako') in Range('AQo+')
예제 #14
0
 def test_combo_in_range(self):
     assert Combo('2s2c') in Range('22')
예제 #15
0
파일: test_range.py 프로젝트: lmacken/poker
 def test_from_percent(self):
     assert Range.from_percent(0.9) == Range('KK+')
예제 #16
0
 def test_multiple_offsuit_hands(self):
     assert Range('AKo 84o').hands == (Hand('84o'), Hand('AKo'))
예제 #17
0
 def test_offsuit_hand(self):
     assert bool(Range('AKo')) is True
예제 #18
0
 def test_hands_without_suit(self):
     assert Range('AK 48').hands == (Hand('84o'), Hand('84s'), Hand('AKo'), Hand('AKs'))
예제 #19
0
 def test_suited_minus(self):
     assert Range('76s-').hands == (Hand('72s'), Hand('73s'), Hand('74s'),
                                    Hand('75s'), Hand('76s'))
예제 #20
0
 def test_dash_offsuit(self):
     assert Range('J8o-J4o').hands == (Hand('J4o'), Hand('J5o'), Hand('J6o'),
                                       Hand('J7o'), Hand('J8o'))
예제 #21
0
 def test_offsuit_and_suited_with_dash_reversed_is_the_same(self):
     assert Range('J8-J4').hands == Range('J4-J8').hands
예제 #22
0
 def test_dash_suited(self):
     assert Range('J8s-J4s').hands == (Hand('J4s'), Hand('J5s'), Hand('J6s'),
                                       Hand('J7s'), Hand('J8s'))
예제 #23
0
 def test_pairs_simple(self):
     """Test if pairs get all the combos."""
     assert Range('22').combos == DEUCE_COMBOS
예제 #24
0
 def test_pairs_backward(self):
     assert Range('44-').hands == (Hand('22'), Hand('33'), Hand('44'))
예제 #25
0
 def test_pairs_with_dash(self):
     assert Range('22-33').combos == DEUCE_COMBOS + THREE_COMBOS
예제 #26
0
 def test_both_suits_with_minus(self):
     assert Range('A5-').hands == (Hand('A2o'), Hand('A2s'), Hand('A3o'), Hand('A3s'),
                                   Hand('A4o'), Hand('A4s'), Hand('A5o'), Hand('A5s'))
예제 #27
0
 def test_pairs(self):
     assert Range('aA') == Range('AA')
     assert Range('TT') == Range('tt')
예제 #28
0
 def test_both_suits_with_plus(self):
     assert Range('A5+').hands == (
         Hand('A5o'), Hand('A5s'), Hand('A6o'), Hand('A6s'), Hand('A7o'), Hand('A7s'),
         Hand('A8o'), Hand('A8s'), Hand('A9o'), Hand('A9s'), Hand('ATo'), Hand('ATs'),
         Hand('AJo'), Hand('AJs'), Hand('AQo'), Hand('AQs'), Hand('AKo'), Hand('AKs')
     )
예제 #29
0
 def test_suited(self):
     assert Range('AKs') == Range('kaS')
예제 #30
0
 def test_offsuit_plus(self):
     assert Range('KJo+').hands == (Hand('KJo'), Hand('KQo'))
예제 #31
0
파일: test_range.py 프로젝트: lmacken/poker
 def test_from_combos(self):
     range = Range.from_objects(DEUCE_COMBOS)
     assert range == Range('22')
     assert range.combos == DEUCE_COMBOS
     assert range.hands == (Hand('22'),)
예제 #32
0
 def test_offsuit_minus(self):
     assert Range('76o-').hands == (Hand('72o'), Hand('73o'), Hand('74o'),
                                    Hand('75o'), Hand('76o'))
예제 #33
0
파일: test_range.py 프로젝트: lmacken/poker
 def test_from_percent_comparison(self):
     # both represents 0.9%, but they should not be equal
     assert Range('AKo') != Range.from_percent(0.9)
예제 #34
0
 def test_hand_combination(self):
     assert bool(Range('AhKs')) is True