from __future__ import annotations import asyncio import pytest from teamlandkarte_mcp.matching.task_helpers import ( TaskHelpersDeprecatedError, extract_requirements_from_task, ) class MissingDB: """DB stub that simulates an unavailable database.""" def get_task_by_id(self, task_id: str): raise RuntimeError("db unavailable") def get_task_by_name(self, name: str): raise RuntimeError("db unavailable") class NoopAnalyzer: async def extract_requirements(self, description: str): # pragma: no cover raise AssertionError("should not be called") def test_extract_requirements_from_task_is_deprecated() -> None: db = MissingDB() analyzer = NoopAnalyzer() with pytest.raises(TaskHelpersDeprecatedError): asyncio.run( extract_requirements_from_task( db=db, analyzer=analyzer, task_id="t", ) )