Files
hockey_new/tests/test_build201_single_goal.py

25 lines
1.1 KiB
Python

"""Ready, running and paused penalties share the real score/physical ACK path."""
import os
from pathlib import Path
import shutil
import subprocess
import pytest
ROOT = Path(__file__).resolve().parents[1]
CASES = tuple(f"ready_{side}_{source}_goal" for side in ("home", "away") for source in ("external", "manual")) + (
"running_minor_still_releases", "started_paused_minor_still_releases", "f2_off_ready_minor_stays",
"ready_opponent_prevents_false_powerplay", "ready_major_stays", "ready_nack_keeps_card",
"ready_unknown_keeps_card", "ready_success_duplicate_is_not_replayed", "ready_double_minor_keeps_second_segment",
)
@pytest.mark.parametrize("case", CASES)
def test_single_goal(case):
node = shutil.which("node")
assert node, "Node is required for production-function regressions"
result = subprocess.run([node, str(ROOT / "tests/build201_single_goal.cjs"), case,
os.environ.get("BUILD201_RUNTIME_ROOT", str(ROOT))], cwd=ROOT, text=True, capture_output=True, timeout=20)
assert result.returncode == 0, result.stdout + result.stderr
assert f"PASS BUILD201 single goal: {case}" in result.stdout, result.stdout + result.stderr