def test_should_activate_strategy_and_valued_pair(): table = _make_table() strategy = TanyaoStrategy(BaseStrategy.TANYAO, table.player) tiles = string_to_136_array(man="23446679", sou="222", honors="55") table.player.init_hand(tiles) assert strategy.should_activate_strategy(table.player.tiles) is False tiles = string_to_136_array(man="23446679", sou="222", honors="22") table.player.init_hand(tiles) assert strategy.should_activate_strategy(table.player.tiles) is True
def test_should_activate_strategy_and_terminal_pairs(): table = _make_table() strategy = TanyaoStrategy(BaseStrategy.TANYAO, table.player) tiles = string_to_136_array(sou="222", man="3459", pin="2399", honors="11") table.player.init_hand(tiles) assert strategy.should_activate_strategy(table.player.tiles) is False tiles = string_to_136_array(sou="22258", man="3566", pin="2399") table.player.init_hand(tiles) assert strategy.should_activate_strategy(table.player.tiles) is True
def test_should_activate_strategy_and_chitoitsu_like_hand(): table = _make_table() strategy = TanyaoStrategy(BaseStrategy.TANYAO, table.player) tiles = string_to_136_array(sou="223388", man="2244", pin="6687") table.player.init_hand(tiles) assert strategy.should_activate_strategy(table.player.tiles) is True
def test_should_activate_strategy_and_already_completed_sided_set(): table = _make_table() strategy = TanyaoStrategy(BaseStrategy.TANYAO, table.player) tiles = string_to_136_array(sou="123234", man="2349", pin="234") table.player.init_hand(tiles) assert strategy.should_activate_strategy(table.player.tiles) is False tiles = string_to_136_array(sou="234789", man="2349", pin="234") table.player.init_hand(tiles) assert strategy.should_activate_strategy(table.player.tiles) is False tiles = string_to_136_array(sou="234", man="1233459", pin="234") table.player.init_hand(tiles) assert strategy.should_activate_strategy(table.player.tiles) is False tiles = string_to_136_array(sou="234", man="2227899", pin="234") table.player.init_hand(tiles) assert strategy.should_activate_strategy(table.player.tiles) is False tiles = string_to_136_array(sou="234", man="2229", pin="122334") table.player.init_hand(tiles) assert strategy.should_activate_strategy(table.player.tiles) is False tiles = string_to_136_array(sou="234", man="2229", pin="234789") table.player.init_hand(tiles) assert strategy.should_activate_strategy(table.player.tiles) is False tiles = string_to_136_array(sou="223344", man="2229", pin="234") table.player.init_hand(tiles) assert strategy.should_activate_strategy(table.player.tiles) is True