diff --git a/backend/app/core/validators.py b/backend/app/core/validators.py index fe671f7..f9c72f5 100644 --- a/backend/app/core/validators.py +++ b/backend/app/core/validators.py @@ -128,12 +128,10 @@ class GameValidator: if not decision.steal_attempts: raise ValidationError("Steal action requires steal_attempts to specify which bases to steal") - # Validate squeeze_bunt - requires R3 and bases NOT loaded + # Validate squeeze_bunt - requires R3, not with 2 outs if decision.action == 'squeeze_bunt': if not state.is_runner_on_third(): raise ValidationError("Squeeze bunt requires a runner on third base") - if len(occupied_bases) == 3: # Bases loaded - raise ValidationError("Squeeze bunt cannot be used with bases loaded") if state.outs >= 2: raise ValidationError("Squeeze bunt cannot be used with 2 outs") diff --git a/backend/tests/unit/core/test_validators.py b/backend/tests/unit/core/test_validators.py index 793dbcd..f1b2e96 100644 --- a/backend/tests/unit/core/test_validators.py +++ b/backend/tests/unit/core/test_validators.py @@ -732,8 +732,8 @@ class TestOffensiveDecisionValidation: assert "squeeze bunt requires a runner on third" in str(exc_info.value).lower() - def test_validate_offensive_decision_action_squeeze_bunt_bases_loaded_fails(self): - """Test squeeze bunt with bases loaded fails""" + def test_validate_offensive_decision_action_squeeze_bunt_bases_loaded_succeeds(self): + """Test squeeze bunt with bases loaded succeeds (no restriction on bases loaded)""" validator = GameValidator() state = GameState( game_id=uuid4(), @@ -748,10 +748,8 @@ class TestOffensiveDecisionValidation: ) decision = OffensiveDecision(action="squeeze_bunt") - with pytest.raises(ValidationError) as exc_info: - validator.validate_offensive_decision(decision, state) - - assert "squeeze bunt cannot be used with bases loaded" in str(exc_info.value).lower() + # Should not raise - squeeze bunt is allowed with bases loaded + validator.validate_offensive_decision(decision, state) def test_validate_offensive_decision_action_squeeze_bunt_two_outs_fails(self): """Test squeeze bunt with 2 outs fails"""