"""Shared fixtures for ComfyUI MCP Server tests."""
import pytest
from src.config import ComfyUISettings
@pytest.fixture()
def mock_config() -> ComfyUISettings:
"""Return a ComfyUISettings with test defaults."""
return ComfyUISettings(
url="http://127.0.0.1:8188",
default_model="test_model_v1.safetensors",
default_steps=10,
default_width=512,
default_height=512,
default_cfg_scale=5.0,
)
@pytest.fixture()
def mock_comfyui_responses() -> dict:
"""Return a dict of typical ComfyUI API responses for mocking."""
return {
"system_stats": {
"system": {
"os": "posix",
"python_version": "3.11.0",
"embedded_python": False,
},
"devices": [
{
"name": "cuda:0",
"type": "cuda",
"vram_total": 8589934592,
"vram_free": 6000000000,
}
],
},
"queue_empty": {
"queue_pending": [],
"queue_running": [],
},
"queue_with_items": {
"queue_pending": [["pending-1", 0, {}, {}]],
"queue_running": [["running-1", 0, {}, {}]],
},
"prompt_response": {
"prompt_id": "test-prompt-id-123",
"number": 1,
"node_errors": {},
},
"history_complete": {
"test-prompt-id-123": {
"outputs": {
"9": {
"images": [
{
"filename": "ComfyUI-MCP_00001_.png",
"subfolder": "",
"type": "output",
}
]
}
}
}
},
"history_empty": {},
"object_info": {
"CheckpointLoaderSimple": {
"input": {
"required": {
"ckpt_name": [
[
"sd_xl_base_1.0.safetensors",
"v1-5-pruned.safetensors",
],
{},
]
}
},
"output": ["MODEL", "CLIP", "VAE"],
"output_name": ["MODEL", "CLIP", "VAE"],
"name": "CheckpointLoaderSimple",
"display_name": "Load Checkpoint",
"category": "loaders",
}
},
}