Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /ViperJuice_Code-Index-MCP /tests /fixtures /slow_plugin.py
| """Slow plugin fixture for timeout testing.""" | |
| import time | |
| from pathlib import Path | |
| from typing import Iterable, Optional | |
| from mcp_server.plugin_base import ( | |
| IndexShard, | |
| IPlugin, | |
| Reference, | |
| SearchOpts, | |
| SearchResult, | |
| SymbolDef, | |
| ) | |
| class SlowPlugin(IPlugin): | |
| """Plugin that sleeps before returning, used to test timeout behavior.""" | |
| lang = "slow" | |
| def __init__(self, sleep_seconds: float, symbol_def: Optional[SymbolDef] = None) -> None: | |
| self._sleep_seconds = sleep_seconds | |
| self._symbol_def = symbol_def | |
| def supports(self, path: str | Path) -> bool: | |
| return str(path).endswith(".slow") | |
| def indexFile(self, path: str | Path, content: str) -> IndexShard: | |
| return {"file": str(path), "symbols": [], "language": "slow"} | |
| def getDefinition(self, symbol: str) -> Optional[SymbolDef]: | |
| time.sleep(self._sleep_seconds) | |
| return self._symbol_def | |
| def findReferences(self, symbol: str) -> Iterable[Reference]: | |
| return [] | |
| def search(self, query: str, opts: SearchOpts | None = None) -> Iterable[SearchResult]: | |
| return [] | |
Xet Storage Details
- Size:
- 1.13 kB
- Xet hash:
- ba6d6c1e12bd88531918452d2a0fedcec4f4d5b08e0c36eccc62a01cccee5941
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.