Перенос LogManager в v2 и обновление документации. Обновлены импорты и исправлены ссылки на LogManager в README и тестах. Удалены устаревшие типы и рефакторинг конфигурации управления.

This commit is contained in:
2026-02-26 20:37:00 +03:00
parent 7b5d6d2156
commit aa32c23dba
22 changed files with 168 additions and 143 deletions

View File

@@ -1,7 +1,7 @@
import asyncio
import json
from config_manager.v2.management import ManagementServer
from config_manager.v2.control import HttpControlChannel
def test_health_mapping_ok_to_200():
@@ -9,7 +9,7 @@ def test_health_mapping_ok_to_200():
return {"status": "ok"}
async def scenario() -> None:
server = ManagementServer(
server = HttpControlChannel(
host="127.0.0.1",
port=8000,
timeout=0.2,
@@ -27,7 +27,7 @@ def test_health_mapping_unhealthy_to_503():
return {"status": "unhealthy", "detail": "worker failed"}
async def scenario() -> None:
server = ManagementServer(
server = HttpControlChannel(
host="127.0.0.1",
port=8000,
timeout=0.2,
@@ -73,21 +73,21 @@ def test_action_routes_call_callbacks():
return status_code, payload
async def scenario() -> None:
server = ManagementServer(
channel = HttpControlChannel(
host="127.0.0.1",
port=0,
timeout=0.2,
health_provider=provider,
)
await server.start(on_start, on_stop, on_status)
await channel.start(on_start, on_stop, on_status)
try:
port = server.port
port = channel.port
assert port > 0
start_code, start_payload = await request(port, "/actions/start")
stop_code, stop_payload = await request(port, "/actions/stop")
finally:
await server.stop()
await channel.stop()
assert start_code == 200
assert start_payload["status"] == "ok"