Files
hermes-agent/tests/agent/test_image_generate_parallel.py
teknium1 2002f03e42 test: purge low-value tests, lane py02 (261 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

45 lines
1.0 KiB
Python

"""Regression tests for parallel image-generation tool batches."""
import json
from types import SimpleNamespace
from unittest.mock import patch
from agent import tool_executor
def _tool_call(name: str, args: dict, call_id: str) -> SimpleNamespace:
return SimpleNamespace(
id=call_id,
function=SimpleNamespace(
name=name,
arguments=json.dumps(args),
),
)
def test_image_generate_parallel_worker_cap_can_be_configured_lower():
runnable_calls = [
(
0,
_tool_call("image_generate", {"prompt": "one"}, "img_1"),
"image_generate",
{},
),
(
1,
_tool_call("image_generate", {"prompt": "two"}, "img_2"),
"image_generate",
{},
),
]
with patch(
"hermes_cli.config.load_config",
return_value={"image_gen": {"max_parallel_requests": 1}},
):
assert tool_executor._max_workers_for_tool_batch(runnable_calls) == 1