mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-11-16 19:36:54 +00:00
Change-detectors, tautologies, source-reading tests, redundant duplicates, mock-echo tests and dead/unrunnable tests. Per-test rationale in the lane ledger (category + reason for every removal).
34 lines
907 B
Python
34 lines
907 B
Python
"""Tests for Matrix outbound message length configuration (#53026)."""
|
|
|
|
|
|
from gateway.config import PlatformConfig
|
|
|
|
|
|
def _make_adapter(**extra):
|
|
from plugins.platforms.matrix.adapter import MatrixAdapter
|
|
|
|
config = PlatformConfig(
|
|
enabled=True,
|
|
token="syt_test_token",
|
|
extra={
|
|
"homeserver": "https://matrix.example.org",
|
|
"user_id": "@bot:example.org",
|
|
**extra,
|
|
},
|
|
)
|
|
return MatrixAdapter(config)
|
|
|
|
|
|
class TestMatrixMaxMessageLength:
|
|
|
|
def test_extra_override(self):
|
|
adapter = _make_adapter(max_message_length=12000)
|
|
assert adapter.max_message_length == 12000
|
|
assert adapter._SPLIT_THRESHOLD == 11900
|
|
|
|
def test_env_override(self, monkeypatch):
|
|
monkeypatch.setenv("MATRIX_MAX_MESSAGE_LENGTH", "20000")
|
|
adapter = _make_adapter()
|
|
assert adapter.max_message_length == 20000
|
|
|
|
|