mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-05-09 11:15:55 +00:00
refactor(msteams): remove obsolete restart notify config
This commit is contained in:
parent
af7fa5bdf9
commit
e625e47a0a
@ -54,11 +54,6 @@ class MSTeamsConfig(Base):
|
|||||||
reply_in_thread: bool = True
|
reply_in_thread: bool = True
|
||||||
mention_only_response: str = "Hi — what can I help with?"
|
mention_only_response: str = "Hi — what can I help with?"
|
||||||
validate_inbound_auth: bool = False
|
validate_inbound_auth: bool = False
|
||||||
restart_notify_enabled: bool = False
|
|
||||||
restart_notify_pre_message: str = (
|
|
||||||
"Nanobot agent initiated a gateway restart. I will message again when the gateway is back online."
|
|
||||||
)
|
|
||||||
restart_notify_post_message: str = "Nanobot gateway is back online."
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
|
|||||||
@ -517,20 +517,8 @@ async def test_start_logs_install_hint_when_pyjwt_missing(make_channel, monkeypa
|
|||||||
def test_msteams_default_config_includes_restart_notify_fields():
|
def test_msteams_default_config_includes_restart_notify_fields():
|
||||||
cfg = MSTeamsChannel.default_config()
|
cfg = MSTeamsChannel.default_config()
|
||||||
|
|
||||||
assert cfg["restartNotifyEnabled"] is False
|
assert "restartNotifyEnabled" not in cfg
|
||||||
assert "restartNotifyPreMessage" in cfg
|
assert "restartNotifyPreMessage" not in cfg
|
||||||
assert "restartNotifyPostMessage" in cfg
|
assert "restartNotifyPostMessage" not in cfg
|
||||||
|
|
||||||
|
|
||||||
def test_msteams_config_accepts_restart_notify_aliases():
|
|
||||||
cfg = MSTeamsConfig.model_validate(
|
|
||||||
{
|
|
||||||
"restartNotifyEnabled": True,
|
|
||||||
"restartNotifyPreMessage": "Restarting now.",
|
|
||||||
"restartNotifyPostMessage": "Back online.",
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
assert cfg.restart_notify_enabled is True
|
|
||||||
assert cfg.restart_notify_pre_message == "Restarting now."
|
|
||||||
assert cfg.restart_notify_post_message == "Back online."
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user