mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-03-19 08:05:05 +08:00
chore: remove accumulate unit tests to reduce PR scope
Some checks failed
Python Linting / Run Ruff (push) Has been cancelled
Python Linting / Run Pylint (push) Has been cancelled
Build package / Build Test (3.10) (push) Has been cancelled
Build package / Build Test (3.11) (push) Has been cancelled
Build package / Build Test (3.12) (push) Has been cancelled
Build package / Build Test (3.13) (push) Has been cancelled
Build package / Build Test (3.14) (push) Has been cancelled
Some checks failed
Python Linting / Run Ruff (push) Has been cancelled
Python Linting / Run Pylint (push) Has been cancelled
Build package / Build Test (3.10) (push) Has been cancelled
Build package / Build Test (3.11) (push) Has been cancelled
Build package / Build Test (3.12) (push) Has been cancelled
Build package / Build Test (3.13) (push) Has been cancelled
Build package / Build Test (3.14) (push) Has been cancelled
This commit is contained in:
parent
a78f700552
commit
c69f9791d7
@ -1,89 +0,0 @@
|
||||
"""
|
||||
Unit tests for the accumulate toggle on SaveImage and PreviewImage nodes.
|
||||
|
||||
Tests that the accumulate input is correctly defined and that the merge flag
|
||||
derivation logic in execution.py works for all input shapes.
|
||||
"""
|
||||
import inspect
|
||||
|
||||
import pytest
|
||||
|
||||
import nodes
|
||||
|
||||
|
||||
class TestSaveImageAccumulateInput:
|
||||
"""Test SaveImage node definition includes accumulate input."""
|
||||
|
||||
def test_accumulate_in_optional_inputs(self):
|
||||
input_types = nodes.SaveImage.INPUT_TYPES()
|
||||
assert "optional" in input_types
|
||||
assert "accumulate" in input_types["optional"]
|
||||
|
||||
def test_accumulate_is_boolean_type(self):
|
||||
input_types = nodes.SaveImage.INPUT_TYPES()
|
||||
accumulate_def = input_types["optional"]["accumulate"]
|
||||
assert accumulate_def[0] == "BOOLEAN"
|
||||
|
||||
def test_accumulate_defaults_to_false(self):
|
||||
input_types = nodes.SaveImage.INPUT_TYPES()
|
||||
accumulate_def = input_types["optional"]["accumulate"]
|
||||
assert accumulate_def[1]["default"] is False
|
||||
|
||||
def test_accumulate_is_advanced(self):
|
||||
input_types = nodes.SaveImage.INPUT_TYPES()
|
||||
accumulate_def = input_types["optional"]["accumulate"]
|
||||
assert accumulate_def[1].get("advanced") is True
|
||||
|
||||
def test_save_images_accepts_accumulate_parameter(self):
|
||||
sig = inspect.signature(nodes.SaveImage.save_images)
|
||||
assert "accumulate" in sig.parameters
|
||||
assert sig.parameters["accumulate"].default is False
|
||||
|
||||
|
||||
class TestPreviewImageAccumulateInput:
|
||||
"""Test PreviewImage node definition includes accumulate input."""
|
||||
|
||||
def test_accumulate_in_optional_inputs(self):
|
||||
input_types = nodes.PreviewImage.INPUT_TYPES()
|
||||
assert "optional" in input_types
|
||||
assert "accumulate" in input_types["optional"]
|
||||
|
||||
def test_accumulate_is_boolean_type(self):
|
||||
input_types = nodes.PreviewImage.INPUT_TYPES()
|
||||
accumulate_def = input_types["optional"]["accumulate"]
|
||||
assert accumulate_def[0] == "BOOLEAN"
|
||||
|
||||
def test_accumulate_defaults_to_false(self):
|
||||
input_types = nodes.PreviewImage.INPUT_TYPES()
|
||||
accumulate_def = input_types["optional"]["accumulate"]
|
||||
assert accumulate_def[1]["default"] is False
|
||||
|
||||
|
||||
class TestAccumulateMergeFlagDerivation:
|
||||
"""Test the merge flag logic used in execution.py.
|
||||
|
||||
In execution.py, the merge flag is derived as:
|
||||
merge = inputs.get('accumulate') is True
|
||||
|
||||
This must return True only for literal True, not for truthy values
|
||||
like lists (which represent node links in the prompt).
|
||||
"""
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"inputs,expected",
|
||||
[
|
||||
({"accumulate": True}, True),
|
||||
({"accumulate": False}, False),
|
||||
({}, False),
|
||||
({"accumulate": None}, False),
|
||||
# Node link: accumulate connected to another node's output
|
||||
({"accumulate": ["other_node_id", 0]}, False),
|
||||
# String "true" should not match
|
||||
({"accumulate": "true"}, False),
|
||||
# Integer 1 should not match
|
||||
({"accumulate": 1}, False),
|
||||
],
|
||||
)
|
||||
def test_merge_flag(self, inputs, expected):
|
||||
merge = inputs.get("accumulate") is True
|
||||
assert merge is expected
|
||||
Loading…
Reference in New Issue
Block a user