test: cover archived heartbeat target selection
This commit is contained in:
@@ -1247,6 +1247,21 @@ def test_heartbeat_skips_bundled_template():
|
||||
assert _heartbeat_has_active_tasks(load_bundled_template("HEARTBEAT.md")) is False
|
||||
|
||||
|
||||
def test_heartbeat_target_skips_archived_webui_sessions():
|
||||
from nanobot.cli.commands import _pick_heartbeat_target_from_sessions
|
||||
|
||||
target = _pick_heartbeat_target_from_sessions(
|
||||
enabled_channels=["websocket"],
|
||||
archived_keys=["websocket:archived"],
|
||||
sessions=[
|
||||
{"key": "websocket:archived"},
|
||||
{"key": "websocket:active"},
|
||||
],
|
||||
)
|
||||
|
||||
assert target == ("websocket", "active")
|
||||
|
||||
|
||||
def _write_instance_config(tmp_path: Path) -> Path:
|
||||
config_file = tmp_path / "instance" / "config.json"
|
||||
config_file.parent.mkdir(parents=True)
|
||||
|
||||
Reference in New Issue
Block a user