agent-team Plane-2: bind P1+P2 to real models, live transport, coordinator #12
1 changed files with 13 additions and 1 deletions
|
|
@ -214,7 +214,19 @@ def test_poster_unsupported_response_raises_type_error() -> None:
|
|||
|
||||
|
||||
def test_missing_token_raises_runtime_error(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
"""No token and no SLACK_BOT_TOKEN raises a clear RuntimeError."""
|
||||
"""No token and no SLACK_BOT_TOKEN raises a clear RuntimeError.
|
||||
|
||||
Stub ``slack_sdk`` into ``sys.modules`` so the deferred import SUCCEEDS and
|
||||
the no-token branch is what's under test. Without this the test is
|
||||
environment-dependent: where slack_sdk is absent (CI) the import-missing
|
||||
error fires first and masks the token check (local-vs-CI drift).
|
||||
"""
|
||||
import sys
|
||||
from types import ModuleType
|
||||
|
||||
fake = ModuleType("slack_sdk")
|
||||
fake.WebClient = lambda **kw: None # type: ignore[attr-defined]
|
||||
monkeypatch.setitem(sys.modules, "slack_sdk", fake)
|
||||
monkeypatch.delenv("SLACK_BOT_TOKEN", raising=False)
|
||||
|
||||
with pytest.raises(RuntimeError, match="Slack bot token"):
|
||||
|
|
|
|||
Reference in a new issue