from __future__ import annotations from unittest.mock import AsyncMock import pytest from finrep_algo_agent.config import Settings from finrep_algo_agent.schemas.outline import OutlineL1Request, OutlineL2Request from finrep_algo_agent.skills.outline_l2.outline_l2 import run_outline_l2 @pytest.mark.asyncio async def test_outline_l2_s2_skips_llm() -> None: settings = Settings(stub_skills=False, llm_api_key="k") llm = AsyncMock() llm.chat_completion = AsyncMock(return_value="{}") req = OutlineL2Request( chapter_name="测试章", chapter_no="1", chapter_presentation_enum="S2", chapter_paragraph_count_enum="P0", l1_task_snapshot=OutlineL1Request(report_type="项目融资"), ) out = await run_outline_l2(req, settings=settings, llm=llm) assert out.chapter_structure == [] assert out.chapter_name == "测试章" llm.chat_completion.assert_not_called()