Files
darth-veitcher 9e6faa0fdf feat: add ComfyUI API endpoint to eliminate CORS issues
- Add /ollama/models API route that proxies requests to Ollama
- Auto-fetch models when client is connected (no workflow execution needed)
- Update JavaScript to call ComfyUI API instead of Ollama directly
- Eliminates CORS browser restrictions
- Much better UX - models appear instantly on connection
- Add api.py with setup_api_routes() function
- Add tests for API module (31 tests passing)
- Update README with auto-fetch feature and technical details
2025-11-02 13:29:58 +00:00

20 lines
646 B
Python

"""Tests for the ComfyUI API routes."""
from comfyui_ollama_model_manager.api import setup_api_routes
def test_setup_api_routes_without_comfyui():
"""Test that setup_api_routes doesn't crash when ComfyUI server is not available."""
# This should not raise an exception even though server module is not available
setup_api_routes()
# If we got here, the function handled the ImportError gracefully
assert True
def test_api_imports():
"""Test that API module can be imported."""
from comfyui_ollama_model_manager import api
assert hasattr(api, "setup_api_routes")
assert callable(api.setup_api_routes)