hermes-agent/tests/gateway/test_matrix_message_length.py
teknium1 61fa0f47ec test: purge low-value tests, lane py07 (216 removed)
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).
2026-09-23 03:15:26 -07:00

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