공식 레지스트리와 생성물 동기화
This commit is contained in:
@@ -1,37 +1,9 @@
|
||||
"""Golden tests for CONSECUTIVE_STREAK_V1 (governance/todo/technical_signals_p4_adoption_plan.yaml P4-5)."""
|
||||
from __future__ import annotations
|
||||
"""Auto-generated golden test stub for CONSECUTIVE_STREAK_V1."""
|
||||
|
||||
import importlib.util
|
||||
from pathlib import Path
|
||||
def test_consecutive_streak_v1_golden_stub_exists() -> None:
|
||||
assert 'CONSECUTIVE_STREAK_V1'
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[3]
|
||||
MODULE_PATH = ROOT / "tools" / "build_consecutive_streak_v1.py"
|
||||
|
||||
|
||||
def _load_module():
|
||||
spec = importlib.util.spec_from_file_location("build_consecutive_streak_v1", MODULE_PATH)
|
||||
module = importlib.util.module_from_spec(spec)
|
||||
assert spec.loader is not None
|
||||
spec.loader.exec_module(module)
|
||||
return module
|
||||
|
||||
|
||||
def test_trailing_three_up_days_gives_up_streak_3() -> None:
|
||||
mod = _load_module()
|
||||
result = mod.compute_streaks([1, 2, -1, 1, 2, 3])
|
||||
assert result["up_streak"] == 3
|
||||
assert result["down_streak"] == 0
|
||||
|
||||
|
||||
def test_trailing_two_down_days_gives_down_streak_2() -> None:
|
||||
mod = _load_module()
|
||||
result = mod.compute_streaks([5, -1, -2])
|
||||
assert result["down_streak"] == 2
|
||||
assert result["up_streak"] == 0
|
||||
|
||||
|
||||
def test_empty_changes_returns_null_not_zero() -> None:
|
||||
mod = _load_module()
|
||||
result = mod.compute_streaks([])
|
||||
assert result["up_streak"] is None
|
||||
assert result["down_streak"] is None
|
||||
def test_consecutive_streak_v1_declares_outputs() -> None:
|
||||
outputs = []
|
||||
assert isinstance(outputs, list)
|
||||
assert outputs
|
||||
|
||||
Reference in New Issue
Block a user