diff --git a/pysollib/games/spider.py b/pysollib/games/spider.py index c0a8cb14..15060780 100644 --- a/pysollib/games/spider.py +++ b/pysollib/games/spider.py @@ -350,8 +350,8 @@ class Scorpion(RelaxedSpider): class ScorpionTail_RowStack(Yukon_AC_RowStack, Spider_RowStack): - canMoveCards = OpenStack.canMoveCards canDropCards = Spider_RowStack.canDropCards + canMoveCards = OpenStack.canMoveCards class ScorpionTail(Scorpion): diff --git a/tests/lib/pysol_tests/scorpion_canMove.py b/tests/lib/pysol_tests/scorpion_canMove.py index aa93936b..96d2203b 100644 --- a/tests/lib/pysol_tests/scorpion_canMove.py +++ b/tests/lib/pysol_tests/scorpion_canMove.py @@ -7,6 +7,7 @@ from pysol_tests.common_mocks1 import MockApp, MockCanvas, MockItem, MockTalon import pysollib.stack from pysollib.acard import AbstractCard from pysollib.games.spider import Scorpion_RowStack, Spider_RowStack +from pysollib.games.spider import ScorpionTail_RowStack class MockGame: @@ -41,9 +42,11 @@ class Mock_S_Game: class MyTests(unittest.TestCase): - def _calc_Scorpion_stack(self): + def _calc_Scorpion_stack(self, isScorpionTail): g = MockGame() - stack = Scorpion_RowStack(0, 0, g) + stack = (ScorpionTail_RowStack(0, 0, g) + if isScorpionTail + else Scorpion_RowStack(0, 0, g)) for s, r in [(2, 5), (3, 7), (2, 7), (2, 0), (2, 3), (2, 4), (1, 4)]: c = AbstractCard(1000+r*100+s*10, 0, s, r, g) c.face_up = True @@ -52,14 +55,16 @@ class MyTests(unittest.TestCase): return stack def test_canMoveCards(self): - stack = self._calc_Scorpion_stack() - stack.canMoveCards(stack.cards[6:]) - self.assertTrue(stack) + for isScorpionTail in [False, True]: + stack = self._calc_Scorpion_stack(isScorpionTail) + stack.canMoveCards(stack.cards[6:]) + self.assertTrue(stack) def test_canMoveCards_non_top(self): - stack = self._calc_Scorpion_stack() - self.assertTrue(stack.canMoveCards(stack.cards[4:])) - self.assertTrue(stack) + for isScorpionTail in [False, True]: + stack = self._calc_Scorpion_stack(isScorpionTail) + self.assertTrue(stack.canMoveCards(stack.cards[4:])) + self.assertTrue(stack) def _calc_Spider_stack(self): g = MockGame()