def test_is_dora(self): table = Table() table.init_round(0, 0, 0, 0, 0, []) table.dora_indicators = [self._string_to_136_tile(sou='1')] self.assertTrue(table.is_dora(self._string_to_136_tile(sou='2'))) table.dora_indicators = [self._string_to_136_tile(sou='9')] self.assertTrue(table.is_dora(self._string_to_136_tile(sou='1'))) table.dora_indicators = [self._string_to_136_tile(pin='9')] self.assertTrue(table.is_dora(self._string_to_136_tile(pin='1'))) table.dora_indicators = [self._string_to_136_tile(man='9')] self.assertTrue(table.is_dora(self._string_to_136_tile(man='1'))) table.dora_indicators = [self._string_to_136_tile(man='5')] self.assertTrue(table.is_dora(self._string_to_136_tile(man='6'))) table.dora_indicators = [self._string_to_136_tile(honors='1')] self.assertTrue(table.is_dora(self._string_to_136_tile(honors='2'))) table.dora_indicators = [self._string_to_136_tile(honors='2')] self.assertTrue(table.is_dora(self._string_to_136_tile(honors='3'))) table.dora_indicators = [self._string_to_136_tile(honors='3')] self.assertTrue(table.is_dora(self._string_to_136_tile(honors='4'))) table.dora_indicators = [self._string_to_136_tile(honors='4')] self.assertTrue(table.is_dora(self._string_to_136_tile(honors='1'))) table.dora_indicators = [self._string_to_136_tile(honors='5')] self.assertTrue(table.is_dora(self._string_to_136_tile(honors='6'))) table.dora_indicators = [self._string_to_136_tile(honors='6')] self.assertTrue(table.is_dora(self._string_to_136_tile(honors='7'))) table.dora_indicators = [self._string_to_136_tile(honors='7')] self.assertTrue(table.is_dora(self._string_to_136_tile(honors='5'))) table.dora_indicators = [self._string_to_136_tile(pin='1')] self.assertFalse(table.is_dora(self._string_to_136_tile(sou='2'))) table.has_open_tanyao = True # red five man self.assertTrue(table.is_dora(FIVE_RED_MAN)) # red five pin self.assertTrue(table.is_dora(FIVE_RED_PIN)) # red five sou self.assertTrue(table.is_dora(FIVE_RED_SOU))
def test_is_dora(self): table = Table() table.init_round(0, 0, 0, 0, 0, []) table.dora_indicators = [self._string_to_136_tile(sou='1')] self.assertTrue(table.is_dora(self._string_to_136_tile(sou='2'))) table.dora_indicators = [self._string_to_136_tile(sou='9')] self.assertTrue(table.is_dora(self._string_to_136_tile(sou='1'))) table.dora_indicators = [self._string_to_136_tile(pin='9')] self.assertTrue(table.is_dora(self._string_to_136_tile(pin='1'))) table.dora_indicators = [self._string_to_136_tile(man='9')] self.assertTrue(table.is_dora(self._string_to_136_tile(man='1'))) table.dora_indicators = [self._string_to_136_tile(man='5')] self.assertTrue(table.is_dora(self._string_to_136_tile(man='6'))) table.dora_indicators = [self._string_to_136_tile(honors='1')] self.assertTrue(table.is_dora(self._string_to_136_tile(honors='2'))) table.dora_indicators = [self._string_to_136_tile(honors='2')] self.assertTrue(table.is_dora(self._string_to_136_tile(honors='3'))) table.dora_indicators = [self._string_to_136_tile(honors='3')] self.assertTrue(table.is_dora(self._string_to_136_tile(honors='4'))) table.dora_indicators = [self._string_to_136_tile(honors='4')] self.assertTrue(table.is_dora(self._string_to_136_tile(honors='1'))) table.dora_indicators = [self._string_to_136_tile(honors='5')] self.assertTrue(table.is_dora(self._string_to_136_tile(honors='6'))) table.dora_indicators = [self._string_to_136_tile(honors='6')] self.assertTrue(table.is_dora(self._string_to_136_tile(honors='7'))) table.dora_indicators = [self._string_to_136_tile(honors='7')] self.assertTrue(table.is_dora(self._string_to_136_tile(honors='5'))) table.dora_indicators = [self._string_to_136_tile(pin='1')] self.assertFalse(table.is_dora(self._string_to_136_tile(sou='2'))) table.has_open_tanyao = True # red five man self.assertTrue(table.is_dora(FIVE_RED_MAN)) # red five pin self.assertTrue(table.is_dora(FIVE_RED_PIN)) # red five sou self.assertTrue(table.is_dora(FIVE_RED_SOU))
def test_is_dora(): table = Table() table.init_round(0, 0, 0, 0, 0, []) table.dora_indicators = [string_to_136_tile(sou="1")] assert table.is_dora(string_to_136_tile(sou="2")) table.dora_indicators = [string_to_136_tile(sou="9")] assert table.is_dora(string_to_136_tile(sou="1")) table.dora_indicators = [string_to_136_tile(pin="9")] assert table.is_dora(string_to_136_tile(pin="1")) table.dora_indicators = [string_to_136_tile(man="9")] assert table.is_dora(string_to_136_tile(man="1")) table.dora_indicators = [string_to_136_tile(man="5")] assert table.is_dora(string_to_136_tile(man="6")) table.dora_indicators = [string_to_136_tile(honors="1")] assert table.is_dora(string_to_136_tile(honors="2")) table.dora_indicators = [string_to_136_tile(honors="2")] assert table.is_dora(string_to_136_tile(honors="3")) table.dora_indicators = [string_to_136_tile(honors="3")] assert table.is_dora(string_to_136_tile(honors="4")) table.dora_indicators = [string_to_136_tile(honors="4")] assert table.is_dora(string_to_136_tile(honors="1")) table.dora_indicators = [string_to_136_tile(honors="5")] assert table.is_dora(string_to_136_tile(honors="6")) table.dora_indicators = [string_to_136_tile(honors="6")] assert table.is_dora(string_to_136_tile(honors="7")) table.dora_indicators = [string_to_136_tile(honors="7")] assert table.is_dora(string_to_136_tile(honors="5")) table.dora_indicators = [string_to_136_tile(pin="1")] assert not table.is_dora(string_to_136_tile(sou="2")) table.has_open_tanyao = True # red five man assert table.is_dora(FIVE_RED_MAN) # red five pin assert table.is_dora(FIVE_RED_PIN) # red five sou assert table.is_dora(FIVE_RED_SOU)