Files
zeekay 95d8461196 Fix CI Quality Gate: exclude vscode-extension from ruff, relax lint rules
- Update quality-gate.yml to only lint hanzo_mcp and tests directories
- Add ruff config to pyproject.toml:
  - Exclude vscode-extension and node_modules
  - Ignore lint rules that conflict with test patterns:
    B023 (loop variable binding), B904 (raise from),
    E741 (ambiguous vars), F401/F821/F841 (unused/undefined in tests)
  - Apply per-file ignores for tests/ and __init__.py
- Apply ruff fixes for import sorting and format
2026-01-17 21:49:47 -08:00

32 lines
1.0 KiB
Python

"""Test helper classes for MCP tools testing."""
from typing import Any, Dict
class PaginatedResponseWrapper:
"""Wrapper class for paginated responses to support tests."""
def __init__(self, items=None, next_cursor=None, has_more=False, total_items=None):
"""Initialize paginated response."""
self.items = items or []
self.next_cursor = next_cursor
self.has_more = has_more
self.total_items = total_items or len(self.items)
def to_json(self) -> Dict[str, Any]:
"""Convert to JSON-serializable dict."""
return {
"items": self.items,
"_meta": {
"next_cursor": self.next_cursor,
"has_more": self.has_more,
"total_items": self.total_items,
},
}
# Export a convenience constructor
def PaginatedResponse(items=None, next_cursor=None, has_more=False, total_items=None):
"""Create a paginated response for testing."""
return PaginatedResponseWrapper(items, next_cursor, has_more, total_items)