From c1c339e396bfe30e558b41f41093ee02c9378158 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=85=B1=E7=89=9B=E8=82=89?= Date: Thu, 10 Sep 2026 17:20:26 +0800 Subject: [PATCH] Fix search test fixture lint warnings --- tests/unit/test_search_step.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/tests/unit/test_search_step.py b/tests/unit/test_search_step.py index d222f901..ce5268c6 100644 --- a/tests/unit/test_search_step.py +++ b/tests/unit/test_search_step.py @@ -46,15 +46,22 @@ class FakeSearchStore(BaseFileStore): self.calls: list[tuple[str, str, int, dict]] = [] async def upsert(self, files: list[tuple[FileNode, list[FileChunk]]]) -> None: - raise NotImplementedError + """Ignore writes in this read-only search fixture.""" + del files async def delete(self, path: str | list[str]) -> None: - raise NotImplementedError + """Ignore deletes in this read-only search fixture.""" + del path async def clear(self) -> None: - raise NotImplementedError + """Clear the fixture's in-memory results and recorded calls.""" + self.vector_results.clear() + self.keyword_results.clear() + self.calls.clear() async def get_nodes(self, paths: list[str] | None = None) -> list[FileNode]: + """Return no graph nodes for search-only tests.""" + del paths return [] async def get_outlinks( @@ -62,6 +69,8 @@ class FakeSearchStore(BaseFileStore): path: str, scope: LinkScopeEnum = LinkScopeEnum.REAL, ) -> list[FileLink]: + """Return no outgoing links for search-only tests.""" + del path, scope return [] async def get_inlinks( @@ -69,13 +78,17 @@ class FakeSearchStore(BaseFileStore): path: str, scope: LinkScopeEnum = LinkScopeEnum.REAL, ) -> list[FileLink]: + """Return no incoming links for search-only tests.""" + del path, scope return [] async def vector_search(self, query: str, limit: int, search_filter: dict) -> list[FileChunk]: + """Return the configured vector results.""" self.calls.append(("vector", query, limit, search_filter)) return self.vector_results[:limit] async def keyword_search(self, query: str, limit: int, search_filter: dict) -> list[FileChunk]: + """Return the configured keyword results.""" self.calls.append(("keyword", query, limit, search_filter)) return self.keyword_results[:limit]