Files
Project_Velocity/backend/tests/oracle/test_persona_service.py
sagnik 4645ff737b feat: Complete code integration of modules (#18)
The complete code integration is done.

Co-authored-by: Sagnik <sagnik7896@gmail.com>
Reviewed-on: #18
2026-04-12 19:20:14 +05:30

27 lines
962 B
Python

from __future__ import annotations
import pytest
from backend.oracle.persona_service import persona_service
@pytest.mark.asyncio
async def test_persona_plan_recommends_templates_for_pipeline_prompt() -> None:
plan = await persona_service.plan_for_prompt(
prompt="Show me a pipeline map and broker trend view for marina whales",
tenant_id="tenant_velocity",
actor_role="sales_director",
)
assert "tpl_pipeline_board_v2" in plan["recommendedTemplates"]
assert plan["canvasBlocks"][0]["type"] == "textCanvas"
@pytest.mark.asyncio
async def test_persona_render_uses_existing_prompt_files() -> None:
rendered = await persona_service.render_prompt(
prompt_name="qd_calculator",
variables={"lead_name": "Amina", "query": "Summarize buyer intent"},
)
assert rendered["promptName"] == "qd_calculator"
assert "Amina" in rendered["renderedPrompt"] or rendered["unresolvedVariables"] is not None