fix(telegram): support matrix source contracts in container
Some checks failed
CD Pipeline / workflow-shape (push) Successful in 1s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 1m15s
CD Pipeline / post-deploy-checks (push) Has been cancelled
CD Pipeline / build-and-deploy (push) Has been cancelled
Some checks failed
CD Pipeline / workflow-shape (push) Successful in 1s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 1m15s
CD Pipeline / post-deploy-checks (push) Has been cancelled
CD Pipeline / build-and-deploy (push) Has been cancelled
This commit is contained in:
@@ -7,6 +7,7 @@ from fastapi.testclient import TestClient
|
||||
|
||||
from src.api.v1.agents import router
|
||||
from src.services.telegram_alert_ai_automation_matrix import (
|
||||
_inspect_source_contract,
|
||||
load_latest_telegram_alert_ai_automation_matrix,
|
||||
)
|
||||
|
||||
@@ -90,6 +91,35 @@ def test_telegram_alert_ai_automation_matrix_loader_returns_gap_matrix():
|
||||
assert marker not in serialized
|
||||
|
||||
|
||||
def test_telegram_matrix_source_contract_supports_container_layout(tmp_path):
|
||||
(tmp_path / "src/services").mkdir(parents=True)
|
||||
(tmp_path / "src/db").mkdir(parents=True)
|
||||
(tmp_path / "src/api/v1/platform").mkdir(parents=True)
|
||||
(tmp_path / "src/services/telegram_gateway.py").write_text(
|
||||
"_mirror_outbound_message\n"
|
||||
"record_outbound_message\n"
|
||||
"ai_automation_alert_card_mirror_v1\n",
|
||||
encoding="utf-8",
|
||||
)
|
||||
(tmp_path / "src/db/awooop_models.py").write_text(
|
||||
'__tablename__ = "awooop_outbound_message"\n',
|
||||
encoding="utf-8",
|
||||
)
|
||||
(tmp_path / "src/api/v1/platform/operator_runs.py").write_text(
|
||||
'"/runs/ai-alert-cards"\n',
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
||||
proof = _inspect_source_contract(tmp_path)
|
||||
|
||||
assert proof["telegram_gateway_mirror_present"] is True
|
||||
assert proof["telegram_gateway_record_outbound_present"] is True
|
||||
assert proof["ai_alert_card_metadata_present"] is True
|
||||
assert proof["outbound_message_model_present"] is True
|
||||
assert proof["ai_alert_card_delivery_readback_endpoint_present"] is True
|
||||
assert proof["ai_alert_card_delivery_readback_endpoint_count"] == 1
|
||||
|
||||
|
||||
def test_telegram_alert_ai_automation_matrix_endpoint_returns_readback():
|
||||
app = FastAPI()
|
||||
app.include_router(router, prefix="/api/v1")
|
||||
|
||||
Reference in New Issue
Block a user