mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-28 01:21:43 +00:00
test: add unit tests for 8 modules (batch 2)
Cover model_tools, toolset_distributions, context_compressor, prompt_caching, cronjob_tools, session_search, process_registry, and cron/scheduler with 127 new test cases.
This commit is contained in:
parent
240f33a06f
commit
ffbdd7fcce
10 changed files with 1112 additions and 0 deletions
36
tests/cron/test_scheduler.py
Normal file
36
tests/cron/test_scheduler.py
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
"""Tests for cron/scheduler.py — origin resolution and delivery routing."""
|
||||
|
||||
import pytest
|
||||
|
||||
from cron.scheduler import _resolve_origin
|
||||
|
||||
|
||||
class TestResolveOrigin:
|
||||
def test_full_origin(self):
|
||||
job = {
|
||||
"origin": {
|
||||
"platform": "telegram",
|
||||
"chat_id": "123456",
|
||||
"chat_name": "Test Chat",
|
||||
}
|
||||
}
|
||||
result = _resolve_origin(job)
|
||||
assert result is not None
|
||||
assert result["platform"] == "telegram"
|
||||
assert result["chat_id"] == "123456"
|
||||
|
||||
def test_no_origin(self):
|
||||
assert _resolve_origin({}) is None
|
||||
assert _resolve_origin({"origin": None}) is None
|
||||
|
||||
def test_missing_platform(self):
|
||||
job = {"origin": {"chat_id": "123"}}
|
||||
assert _resolve_origin(job) is None
|
||||
|
||||
def test_missing_chat_id(self):
|
||||
job = {"origin": {"platform": "telegram"}}
|
||||
assert _resolve_origin(job) is None
|
||||
|
||||
def test_empty_origin(self):
|
||||
job = {"origin": {}}
|
||||
assert _resolve_origin(job) is None
|
||||
Loading…
Add table
Add a link
Reference in a new issue