feat(irc): add interactive setup
feat(gateway): refine Platform._missing_ and platform-connected dispatch Restricts plugin-name acceptance to bundled plugin scan + registry (no arbitrary string -> enum-pollution), pulls per-platform connectivity checks into a _PLATFORM_CONNECTED_CHECKERS lambda map with a clean _is_platform_connected method, and adds tests covering the checker map, plugin platform interface, and IRC setup wizard.
This commit is contained in:
@@ -89,12 +89,14 @@ class TestSessionSourceRoundtrip:
|
||||
assert restored.chat_topic is None
|
||||
assert restored.chat_type == "dm"
|
||||
|
||||
def test_unknown_platform_accepted_for_plugins(self):
|
||||
"""Unknown platform names are now accepted (dynamic enum members for
|
||||
plugin platforms), so from_dict should succeed rather than raise."""
|
||||
source = SessionSource.from_dict({"platform": "nonexistent", "chat_id": "1"})
|
||||
assert source.platform.value == "nonexistent"
|
||||
assert source.chat_id == "1"
|
||||
def test_unknown_platform_rejected_for_bad_names(self):
|
||||
"""Arbitrary platform names are rejected (no accidental enum pollution).
|
||||
|
||||
Only bundled platform plugins (discovered under ``plugins/platforms/``)
|
||||
and runtime-registered plugins get dynamic enum members.
|
||||
"""
|
||||
with pytest.raises(ValueError):
|
||||
SessionSource.from_dict({"platform": "nonexistent", "chat_id": "1"})
|
||||
|
||||
|
||||
class TestSessionSourceDescription:
|
||||
|
||||
Reference in New Issue
Block a user