def test_get_card_probs_holdem(self): env_bldr = get_holdem_env_bldr() range_ = PokerRange(env_bldr=env_bldr) cards_to_remove = np.array([0, 3, 6, 33, 21, 51], np.int8) # use previously tested method to make this test easier range_.set_cards_to_zero_prob( cards_2d=env_bldr.lut_holder.get_2d_cards(cards_to_remove)) r = range_.get_card_probs() assert np.allclose(np.sum(r), 2, atol=0.00001) for c in cards_to_remove: assert np.allclose(r[c], 0, atol=0.00001)
def test_get_card_probs_leduc(self): env_bldr = get_leduc_env_bldr() range_ = PokerRange(env_bldr=env_bldr) assert np.array_equal(range_.get_card_probs(), range_._range)