summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Rohdewald <wolfgang@rohdewald.de>2016-08-22 06:55:11 (GMT)
committerWolfgang Rohdewald <wolfgang@rohdewald.de>2016-08-25 06:43:12 (GMT)
commitf259b1eedc7b06ad59f33a763f899079ff001bc1 (patch)
tree34aeb8a7df2d671ae2fad34d1ec3329060c86dba
parent2482451d5ecd0d4ac6ba4fac6f2b37c5cb2b2eb3 (diff)
BlessingOfEarth had no tests
-rw-r--r--src/rulecode.py5
-rwxr-xr-xsrc/scoringtest.py2
2 files changed, 6 insertions, 1 deletions
diff --git a/src/rulecode.py b/src/rulecode.py
index 24c360e..16f7b98 100644
--- a/src/rulecode.py
+++ b/src/rulecode.py
@@ -1277,7 +1277,10 @@ class BlessingOfHeaven(RuleCode):
class BlessingOfEarth(RuleCode):
def appliesToHand(hand):
- return hand.ownWind is not East and hand.lastSource == '1'
+ result = hand.ownWind is not East and hand.lastSource == '1'
+ if result:
+ assert hand.lastTile.isExposed, '{}: Blessing of Earth: last tile must be exposed'.format(hand)
+ return result
def selectable(hand):
"""for scoring game"""
diff --git a/src/scoringtest.py b/src/scoringtest.py
index 705e495..7b36253 100755
--- a/src/scoringtest.py
+++ b/src/scoringtest.py
@@ -731,6 +731,8 @@ class Blessing(Base):
[Win(limits=1), NoWin()])
self.scoreTest('s4s5s6 RS1S1S1B6B6B6B8B8B8 b5b5 fn yn m1 LS1S1S1S1',
Win(limits=1))
+ self.scoreTest('s4s5s6 RS1S2S3B6B6B7B7B8B8 b5b5 fn yn m1 Ls4s4s5s6',
+ [Win(limits=1), NoWin()], myWind=West)
class Terminals(Base):