test(governance): isolate dispatcher skip cooldown
Some checks failed
CD Pipeline / workflow-shape (push) Successful in 0s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Failing after 3m5s
CD Pipeline / build-and-deploy (push) Has been skipped
CD Pipeline / post-deploy-checks (push) Has been skipped

This commit is contained in:
ogt
2026-07-10 00:49:38 +08:00
parent 9cf01f1cf7
commit e8ab80023c

View File

@@ -26,6 +26,19 @@ TAIPEI = timezone(timedelta(hours=8))
NOW = datetime(2026, 5, 3, 12, 0, tzinfo=TAIPEI)
@pytest.fixture(autouse=True)
def _isolate_skip_cooldown(monkeypatch: pytest.MonkeyPatch) -> None:
"""Keep dispatcher unit tests independent from live Redis cooldown state."""
monkeypatch.setattr(
"src.services.governance_dispatcher._is_skip_cooldown",
AsyncMock(return_value=False),
)
monkeypatch.setattr(
"src.services.governance_dispatcher._set_skip_cooldown",
AsyncMock(),
)
def _make_governance_event(
event_id: str = "evt-001",
event_type: str = "trust_drift",