Set scopa targets to their traditional defaults
CI / Build and push docker image (push) Successful in 2m6s
CI / Build and push docker image (push) Successful in 2m6s
Partnership games go to 21: scopone scientifico (the tournament target) and scopa a quattro, while two-player scopa keeps its usual 11. The scopa package resolves the default from the player count and exposes a per variant options_schema default, so the lobby creation form shows the right value without frontend changes.
This commit is contained in:
@@ -172,11 +172,20 @@ class DealTest(unittest.TestCase):
|
||||
def test_create_game_defaults(self) -> None:
|
||||
state = engine.create_game("p0", "p0")
|
||||
self.assertEqual(2, state.player_count)
|
||||
# Two-player scopa is traditionally played to 11 points.
|
||||
self.assertEqual(11, state.target_score)
|
||||
self.assertFalse(state.asso_pigliatutto)
|
||||
self.assertEqual("p0", state.players[0].sub)
|
||||
self.assertEqual("lobby", state.phase)
|
||||
|
||||
def test_create_game_four_player_default_target(self) -> None:
|
||||
# The four-player partnership game (like scopone) goes to 21.
|
||||
state = engine.create_game("p0", "p0", player_count=4)
|
||||
self.assertEqual(21, state.target_score)
|
||||
# An explicit target still wins over the default.
|
||||
explicit = engine.create_game("p0", "p0", player_count=4, target_score=16)
|
||||
self.assertEqual(16, explicit.target_score)
|
||||
|
||||
def test_create_game_player_count_validation(self) -> None:
|
||||
for bad in (1, 3, 5, 0):
|
||||
with self.assertRaises(IllegalMove):
|
||||
|
||||
Reference in New Issue
Block a user