50 lines
1.7 KiB
Python
50 lines
1.7 KiB
Python
"""RED contract coverage for the explicit original AuraFlow SIGMAS node."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import json
|
|
|
|
import pytest
|
|
from comfyui_sigmax import NODE_CLASS_MAPPINGS
|
|
from comfyui_sigmax.core import ScheduleContractError
|
|
from comfyui_sigmax.nodes.aura_flow_sigma_scheduler import (
|
|
AURAFLOW_SIGMA_NODE_ID,
|
|
AURAFLOW_SIGMA_NODE_SCHEMA_ID,
|
|
AuraFlowSigmaScheduler,
|
|
build_aura_flow_sigma_schedule,
|
|
)
|
|
|
|
|
|
def test_auraflow_node_is_registered_with_one_explicit_mode() -> None:
|
|
assert AURAFLOW_SIGMA_NODE_ID == "Sigmax.AuraFlowSigmaScheduler"
|
|
assert NODE_CLASS_MAPPINGS[AURAFLOW_SIGMA_NODE_ID] is AuraFlowSigmaScheduler
|
|
inputs = AuraFlowSigmaScheduler.INPUT_TYPES()["required"]
|
|
assert inputs["mode"][0] == ("Official Fixed (1.73)",)
|
|
assert AuraFlowSigmaScheduler.RETURN_TYPES == ("SIGMAS", "STRING")
|
|
|
|
|
|
def test_auraflow_node_metadata_is_canonical_and_source_explicit() -> None:
|
|
result = build_aura_flow_sigma_schedule(
|
|
mode="Official Fixed (1.73)",
|
|
steps=50,
|
|
strict_source=False,
|
|
start_step=0,
|
|
end_step=-1,
|
|
)
|
|
info = json.loads(result.schedule_info_json)
|
|
assert info["schema"] == AURAFLOW_SIGMA_NODE_SCHEMA_ID
|
|
assert info["profile"]["id"] == "auraflow.v0-2.official"
|
|
assert info["shift"] == {"kind": "direct_ratio", "multiplier": 1.0, "ratio": 1.73}
|
|
assert info["slicing"]["output_steps"] == 50
|
|
|
|
|
|
def test_auraflow_node_rejects_implicit_or_invalid_mode_before_output() -> None:
|
|
with pytest.raises(ScheduleContractError, match="mode"):
|
|
build_aura_flow_sigma_schedule(
|
|
mode="auto",
|
|
steps=50,
|
|
strict_source=False,
|
|
start_step=0,
|
|
end_step=-1,
|
|
)
|