Files
hermes-agent/tests/tools/test_image_generation_plugin_dispatch.py
teknium1 5f6b1d251f test: purge low-value tests, lane py17 (495 removed)
Change-detectors, tautologies, source-reading tests, redundant duplicates,
mock-echo tests and dead/unrunnable tests. Per-test rationale in the lane
ledger (category + reason for every removal).
2026-09-23 03:15:26 -07:00

35 lines
1.2 KiB
Python

from __future__ import annotations
import pytest
from agent import image_gen_registry
@pytest.fixture(autouse=True)
def _reset_registry():
image_gen_registry._reset_for_tests()
yield
image_gen_registry._reset_for_tests()
class TestPluginDispatch:
def test_deepinfra_key_alone_does_not_select_image_backend(self, monkeypatch):
"""DeepInfra chat credentials do not imply consent to image billing."""
from tools import image_generation_tool
monkeypatch.setenv("DEEPINFRA_API_KEY", "«redacted:sk-…»")
monkeypatch.delenv("FAL_KEY", raising=False)
monkeypatch.setattr(image_generation_tool, "_read_configured_image_provider", lambda: None)
assert image_generation_tool._dispatch_to_plugin_provider("a cat", "square") is None
def test_requirements_ignore_unselected_paid_plugin(self, monkeypatch):
from tools import image_generation_tool
monkeypatch.setattr(image_generation_tool, "check_fal_api_key", lambda: False)
monkeypatch.setattr(
image_generation_tool, "_read_configured_image_provider", lambda: None
)
assert image_generation_tool.check_image_generation_requirements() is False