def test_honors(self): data = [["2/", "5/", "8/"], ["1#", "4#", "7#"], ["3●", "6●", "9●"], ["2/", "3/", "4/"], ["B", "B"]] hand = Hand(data) self.examination = AllChows(hand) self.passed = self.examination.evaluate() self.assertFalse(self.passed)
def setUp(self): data = [["W", "W", "W", "W"], ["8#", "8#", "8#", "8#"], ["3#", "3#", "3#", "3#"], ["2/", "2/", "2/", "2/"], ["3●", "3●"]] hand = Hand(data) self.examination = FourKongs(hand) self.passed = self.examination.evaluate()
def test_special_hand(self): hand = Hand([[ "E", "E", "8/", "8/", "4#", "4#", "4●", "4●", "N", "N", "9#", "9#", "B", "B" ]]) regular_tilesets = hand.pair + hand.pungs + hand.kongs + hand.chows + hand.knitted self.assertEqual(len(regular_tilesets), 0)
def test_not_three_pungs(self): data = [["6●", "7●", "8●"], ["B", "B", "B"], ["3●", "3●", "3●", "3●"], ["2/", "2/"], ["1#", "2#", "3#"]] hand = Hand(data, {"concealed": True}) self.examination = ThreeConcealedPungs(hand) self.passed = self.examination.evaluate() self.assertFalse(self.passed)
def test_not_four_pungs(self): data = [["3#", "4#", "5#"], ["C", "C"], ["6●", "6●", "6●"], ["7#", "7#", "7#"], ["8/", "8/", "8/", "8/"]] hand = Hand(data, {"concealed": True}) self.examination = FourConcealedPungs(hand) self.passed = self.examination.evaluate() self.assertFalse(self.passed)
def test_standard_hand(self): data = [["1●", "2●", "3●"], ["4#", "5#", "6#"], ["7/", "8/", "9/"], ["2#", "3#", "4#"], ["F", "F"]] hand = Hand(data) self.examination = NoHonorTiles(hand) self.passed = self.examination.evaluate() self.assertFalse(self.passed)
def test_not_nine_gates(self): data = [["1#", "1#", "1#"], ["3#", "4#", "5#"], ["5#", "6#", "7#"], ["7#", "8#", "9#"], ["9#", "9#"]] hand = Hand(data) self.examination = NineGates(hand) self.passed = self.examination.evaluate() self.assertFalse(self.passed)
def setUp(self): data = [["1●", "2●", "3●"], ["4#", "5#", "6#"], ["7/", "8/", "9/"], ["2#", "3#", "4#"], ["1/", "1/"]] hand = Hand(data, {"winning tile": "Last Tile Claim"}) self.examination = LastTileClaim(hand) self.passed = self.examination.evaluate() self.assertTrue(self.passed)
def test_out_with_replacement_tile(self): data = [["6/", "6/", "6/", "6/"], ["2/", "3/", "4/"], ["F", "F", "F"], ["2/", "3/", "4/"], ["8/", "8/"]] hand = Hand(data, {"winning tile": "Out with Replacement Tile"}) self.examination = OutWithReplacementTile(hand) self.passed = self.examination.evaluate() self.assertTrue(self.passed)
def test_last_tile(self): data = [["S", "S", "S"], ["E", "E", "E"], ["W", "W", "W"], ["N", "N", "N"], ["3#", "3#"]] hand = Hand(data, {"winning tile": "Last Tile"}) self.examination = LastTile(hand) self.passed = self.examination.evaluate() self.assertTrue(self.passed)
def test_last_tile_draw(self): data = [["C", "C", "C"], ["F", "F", "F"], ["B", "B", "B"], ["5#", "6#", "7#"], ["3#", "3#"]] hand = Hand(data, {"winning tile": "Last Tile Draw"}) self.examination = LastTileDraw(hand) self.passed = self.examination.evaluate() self.assertTrue(self.passed)
def setUp(self): data = [["S", "S", "S"], ["E", "E", "E"], ["W", "W", "W"], ["N", "N", "N"], ["3#", "3#"]] hand = Hand(data, {"winning tile": "Single Wait"}) self.examination = SingleWait(hand) self.passed = self.examination.evaluate() self.assertTrue(self.passed)
def test_closed_wait(self): data = [["1●", "2●", "3●"], ["7●", "8●", "9●"], ["1/", "2/", "3/"], ["7/", "8/", "9/"], ["5#", "5#"]] hand = Hand(data, {"winning tile": "Closed Wait"}) self.examination = ClosedWait(hand) self.passed = self.examination.evaluate() self.assertTrue(self.passed)
def test_robbing_the_kong(self): data = [["1●", "2●", "3●"], ["7●", "8●", "9●"], ["1/", "2/", "3/"], ["7/", "8/", "9/"], ["5#", "5#"]] hand = Hand(data, {"winning tile": "Robbing the Kong"}) self.examination = RobbingTheKong(hand) self.passed = self.examination.evaluate() self.assertTrue(self.passed)
def test_full_concealment(self): data = [["7#", "7#"], ["8#", "8#", "8#"], ["3●", "4●", "5●"], ["1/", "1/", "1/"], ["N", "N", "N"]] hand = Hand(data, {"concealed": True}) self.examination = ConcealedHand(hand) self.passed = self.examination.evaluate() self.assertFalse(self.passed)
def test_not_kong(self): data = [["6/", "6/", "6/"], ["2/", "3/", "4/"], ["F", "F", "F"], ["2/", "3/", "4/"], ["8/", "8/"]] hand = Hand(data) self.examination = TwoKongs(hand) self.passed = self.examination.evaluate() self.assertFalse(self.passed)
def test_melded(self): data = [["7#", "7#"], ["8#", "8#", "8#"], ["3●", "4●", "5●"], ["1/", "1/", "1/"], ["N", "N", "N"]] hand = Hand(data) self.examination = ConcealedHand(hand) self.passed = self.examination.evaluate() self.assertFalse(self.passed)
def test_one_melded(self): data = [["W", "W", "W"], ["8#", "8#", "8#", "8#"], ["3#", "3#", "3#", "3#"], ["2/", "2/", "2/"], ["3●", "3●"]] hand = Hand(data, {"concealed": [False, False, True, False, False]}) self.examination = TwoKongs(hand) self.passed = self.examination.evaluate() self.assertFalse(self.passed)
def test_not_concealed_hand(self): data = [["1/", "1/"], ["1/", "2/", "3/"], ["4/", "5/", "6/"], ["7/", "8/", "9/"], ["9/", "9/", "9/"]] hand = Hand(data, {"concealed": [False, True, False, False, True]}) self.examination = NineGates(hand) self.passed = self.examination.evaluate() self.assertFalse(self.passed)
def test_standard_set(self): data = [["6●", "6●", "6●"], ["7●", "7●", "7●"], ["8●", "8●", "8●"], ["9●", "9●", "9●"], ["2●", "2●"]] hand = Hand(data) self.examination = SevenShiftedPairs(hand) self.passed = self.examination.evaluate() self.assertFalse(self.passed)
def test_includes_kong(self): data = [["1/", "1/", "1/", "1/"], ["2/", "2/"], ["3/", "4/", "5/"], ["6/", "7/", "8/"], ["9/", "9/", "9/"]] hand = Hand(data, {"concealed": [True, False, True, True, True]}) self.examination = NineGates(hand) self.passed = self.examination.evaluate() self.assertFalse(self.passed)
def setUp(self): data = [[ "8/", "8/", "3/", "3/", "4/", "4/", "9/", "9/", "6/", "6/", "7/", "7/", "5/", "5/" ]] hand = Hand(data) self.examination = Scoring(hand)
def test_standard_set(self): data = [["W", "W", "W"], ["E", "E", "E"], ["N", "N", "N"], ["1#", "2#", "3#"], ["C", "C"]] hand = Hand(data) self.examination = ThirteenOrphans(hand) self.passed = self.examination.evaluate() self.assertFalse(self.passed)
def test_not_terminal(self): data = [["1●", "2●", "3●"], ["4●", "5●", "6●"], ["1●", "2●", "3●"], ["7●", "8●", "9●"], ["5●", "5●"]] hand = Hand(data) self.examination = PureTerminalChows(hand) self.passed = self.examination.evaluate() self.assertFalse(self.passed)
def test_not_concealed(self): data = [["6●", "6●", "6●"], ["B", "B", "B"], ["3●", "3●", "3●"], ["2/", "2/"], ["1#", "1#", "1#", "1#"]] hand = Hand(data) self.examination = FourConcealedPungs(hand) self.passed = self.examination.evaluate() self.assertFalse(self.passed)
def test_not_pure(self): data = [["1●", "2●", "3●"], ["7●", "8●", "9●"], ["1/", "2/", "3/"], ["7/", "8/", "9/"], ["5#", "5#"]] hand = Hand(data) self.examination = PureTerminalChows(hand) self.passed = self.examination.evaluate() self.assertFalse(self.passed)
def test_one_concealed(self): data = [["6/", "6/", "6/", "6/"], ["2/", "3/", "4/"], ["F", "F", "F", "F"], ["2/", "3/", "4/"], ["8/", "8/"]] hand = Hand(data, {"concealed": [True, True, False, True, False]}) self.examination = TwoConcealedKongs(hand) self.passed = self.examination.evaluate() self.assertFalse(self.passed)
def test_standard_hand(self): data = [["7#", "7#"], ["8#", "8#", "8#"], ["3●", "4●", "5●"], ["1/", "1/", "1/"], ["N", "N", "N"]] hand = Hand(data, {"concealed": [False, True, False, True, True]}) self.examination = ConcealedHand(hand) self.passed = self.examination.evaluate() self.assertFalse(self.passed)
def test_standard_hand(self): data = [["2/", "3/", "4/"], ["3/", "4/", "5/"], ["4/", "5/", "6/"], ["5/", "6/", "7/"], ["8/", "8/"]] hand = Hand(data) self.examination = AllGreen(hand) self.passed = self.examination.evaluate() self.assertFalse(self.passed)
def test_standard_hand(self): data = [["1●", "2●", "3●"], ["4#", "5#", "6#"], ["7/", "8/", "9/"], ["3#", "3#", "3#"], ["1/", "1/"]] hand = Hand(data) self.examination = AllChows(hand) self.passed = self.examination.evaluate() self.assertFalse(self.passed)