Files
hermes-agent/tests/tools/test_open_preview_tool.py
teknium1 f596ed1595 test: purge low-value tests, lane py18 (303 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

26 lines
567 B
Python

"""Tests for the GUI-surface ``open_preview`` tool."""
import json
import pytest
from tools import desktop_ui, open_preview_tool as op
@pytest.fixture(autouse=True)
def _reset_emitter():
"""Each test controls the emitter; never leak one across tests."""
desktop_ui.set_emitter(None)
yield
desktop_ui.set_emitter(None)
def test_emitter_failure_is_reported():
def _boom(*_a):
raise RuntimeError("no window")
desktop_ui.set_emitter(_boom)
assert "no window" in json.loads(op.open_preview_tool("https://x.example"))["error"]