New nodes (5):
- Relay: local message delivery between agents (outbox→inbox)
- ChatHistory: multi-turn conversation persistence across runs
- PromptTemplate: {a}/{b}/{c}/{d} variable substitution
- ConditionalRouter: keyword/regex routing with matched/unmatched outputs
- BatchSplitter: split text into numbered sections by delimiter
Fixed nodes (3):
- TextCombine: removed forceInput, text_a/text_b now typeable widgets
- Remember: removed forceInput on text, now typeable widget
- Send: removed forceInput on body, now typeable widget
Demo workflows (7):
1. Character Design - art director with memory for consistent characters
2. Novel Crafter - writer+editor dual-agent with Relay message delivery
3. Story to Video - director breaks story into scenes with BatchSplitter
4. Multi-Turn Chat - persistent conversation history across queue runs
5. Agent Debate - two agents argue via message passing (FOR vs AGAINST)
6. World Builder - game world with PromptTemplate for locations/characters
7. RAG Pipeline - store docs, search, answer with ConditionalRouter error handling
76 tests all passing (46 original + 30 new).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
30 lines
936 B
Python
30 lines
936 B
Python
"""Tests for AgentAZAll ComfyUI utility nodes (TextDisplay, TextCombine)."""
|
|
|
|
import pytest
|
|
|
|
from nodes.utility_nodes import AgentAZAll_TextDisplay, AgentAZAll_TextCombine
|
|
|
|
|
|
class TestTextDisplay:
|
|
|
|
def test_display_returns_ui(self):
|
|
"""TextDisplay returns UI dict with text content."""
|
|
node = AgentAZAll_TextDisplay()
|
|
result = node.display("Hello, world!")
|
|
assert result == {"ui": {"text": ["Hello, world!"]}}
|
|
|
|
|
|
class TestTextCombine:
|
|
|
|
def test_default_separator(self):
|
|
"""TextCombine joins with default double-newline separator."""
|
|
node = AgentAZAll_TextCombine()
|
|
(result,) = node.combine("Part A", "Part B")
|
|
assert result == "Part A\n\nPart B"
|
|
|
|
def test_custom_separator(self):
|
|
"""TextCombine uses custom separator."""
|
|
node = AgentAZAll_TextCombine()
|
|
(result,) = node.combine("One", "Two", " | ")
|
|
assert result == "One | Two"
|