コード例 #1
0
 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)
コード例 #2
0
 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()
コード例 #3
0
ファイル: test_hand.py プロジェクト: kajiki/mahjongg-scoring
 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)
コード例 #4
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)
コード例 #5
0
 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)
コード例 #6
0
 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)
コード例 #7
0
 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)
コード例 #8
0
 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)
コード例 #9
0
 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)
コード例 #10
0
 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)
コード例 #11
0
 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)
コード例 #12
0
 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)
コード例 #13
0
 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)
コード例 #14
0
 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)
コード例 #15
0
 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)
コード例 #16
0
 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)
コード例 #17
0
 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)
コード例 #18
0
 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)
コード例 #19
0
 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)
コード例 #20
0
 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)
コード例 #21
0
 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)
コード例 #22
0
 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)
コード例 #23
0
 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)
コード例 #24
0
 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)
コード例 #25
0
 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)
コード例 #26
0
 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)
コード例 #27
0
 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)
コード例 #28
0
 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)
コード例 #29
0
 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)
コード例 #30
0
 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)