Files
invoke-ai--invokeai/tests/backend/z_image/test_z_image_controlnet_extension.py
T
wehub-resource-sync cddb07a176
docs / deploy (push) Has been cancelled
docs / changes (push) Has been cancelled
docs / check-and-build (push) Has been cancelled
build container image / cpu (push) Has been cancelled
build container image / cuda (push) Has been cancelled
build container image / rocm (push) Has been cancelled
frontend checks / frontend-checks (push) Has been cancelled
frontend tests / frontend-tests (push) Has been cancelled
lfs checks / lfs-check (push) Has been cancelled
python checks / python-checks (push) Has been cancelled
python tests / py3.12: macos-default (push) Has been cancelled
python tests / py3.11: windows-cpu (push) Has been cancelled
python tests / py3.12: windows-cpu (push) Has been cancelled
python tests / py3.11: linux-cpu (push) Has been cancelled
typegen checks / typegen-checks (push) Has been cancelled
uv lock checks / uv-lock-checks (push) Has been cancelled
openapi checks / openapi-checks (push) Has been cancelled
python tests / py3.11: macos-default (push) Has been cancelled
python tests / py3.12: linux-cpu (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:22:06 +08:00

25 lines
784 B
Python

from types import SimpleNamespace
from unittest.mock import patch
import torch
from invokeai.backend.z_image.z_image_controlnet_extension import ZImageControlNetExtension
def test_init_logs_control_adapter_diagnostics_without_stdout(capsys):
control_adapter = SimpleNamespace(
control_layers=[
SimpleNamespace(
after_proj=SimpleNamespace(weight=torch.zeros(1)),
)
]
)
with patch("invokeai.backend.z_image.z_image_controlnet_extension.logger") as logger_mock:
ZImageControlNetExtension(control_adapter=control_adapter, control_cond=torch.zeros(1))
captured = capsys.readouterr()
assert captured.out == ""
assert logger_mock.debug.call_count == 3
logger_mock.warning.assert_called_once()