mirror of
https://github.com/mcloh/Enterprise-MCP-Service-Bus.git
synced 2026-11-05 22:14:11 +00:00
M0 e M1 revisados e fixes implementados
This commit is contained in:
23
RI/tests/unit/test_gateway_cache.py
Normal file
23
RI/tests/unit/test_gateway_cache.py
Normal file
@@ -0,0 +1,23 @@
|
||||
"""Private tools/list cache hint (EP-05-T03, README.md §13/§28)."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
from emcp_bus.gateway.cache import tools_list_cache_hint
|
||||
|
||||
|
||||
def test_default_hint_is_private_scope_with_a_positive_ttl() -> None:
|
||||
hint = tools_list_cache_hint()
|
||||
|
||||
assert hint.scope == "private"
|
||||
assert hint.ttl_ms > 0
|
||||
|
||||
|
||||
def test_ttl_is_configurable_via_env_var(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
monkeypatch.setenv("EMCP_TOOLS_LIST_CACHE_TTL_MS", "12345")
|
||||
|
||||
hint = tools_list_cache_hint()
|
||||
|
||||
assert hint.ttl_ms == 12345
|
||||
assert hint.scope == "private" # never configurable to "public" (Teste 5, §45)
|
||||
Reference in New Issue
Block a user