test_outline_l2_s2_skip_llm.py 935 B

123456789101112131415161718192021222324252627
  1. from __future__ import annotations
  2. from unittest.mock import AsyncMock
  3. import pytest
  4. from finrep_algo_agent.config import Settings
  5. from finrep_algo_agent.schemas.outline import OutlineL1Request, OutlineL2Request
  6. from finrep_algo_agent.skills.outline_l2.outline_l2 import run_outline_l2
  7. @pytest.mark.asyncio
  8. async def test_outline_l2_s2_skips_llm() -> None:
  9. settings = Settings(stub_skills=False, llm_api_key="k")
  10. llm = AsyncMock()
  11. llm.chat_completion = AsyncMock(return_value="{}")
  12. req = OutlineL2Request(
  13. chapter_name="测试章",
  14. chapter_no="1",
  15. chapter_presentation_enum="S2",
  16. chapter_paragraph_count_enum="P0",
  17. l1_task_snapshot=OutlineL1Request(report_type="项目融资"),
  18. )
  19. out = await run_outline_l2(req, settings=settings, llm=llm)
  20. assert out.chapter_structure == []
  21. assert out.chapter_name == "测试章"
  22. llm.chat_completion.assert_not_called()