Add comprehensive test coverage for routes and nodes

Tests cover:
- routes.py: Input validation, path traversal protection, JSON
  error handling, GUID sanitization (12 new tests)
- nodes/ideogram4_nodes.py: Prompt assembly, bbox normalization,
  palette handling, JSON serialization, input coercion (28 new tests)

All tests use mocks via conftest.py to avoid ComfyUI dependencies.
Tests import the repo as a proper package so routes.py relative
imports work unchanged.

CI: Install aiohttp for route tests.

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
This commit is contained in:
by-ae
2026-10-23 21:16:56 +00:00
co-authored by Cursor Agent
parent 10176bc713
commit 223ec7e15b
4 changed files with 511 additions and 2 deletions
+2 -2
View File
@@ -24,7 +24,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
pip install flake8 aiohttp pytest pytest-asyncio
- name: Lint with flake8
run: |
@@ -43,7 +43,7 @@ jobs:
- name: Run unit tests
run: |
python -m unittest discover -s tests -p 'test_*.py' -v
python -m pytest tests/ -v
javascript-check:
runs-on: ubuntu-latest