strix/tests/test_interface_messages.py
mitnick 84d48db6ea fix(interface): remove dead reasoning-effort branches, fix model name and STRIX_IMAGE casing
Drop the two unreachable STRIX_REASONING_EFFORT branches in
validate_environment (the var is never added to missing_optional_vars),
replace the stale anthropic/claude-opus-4-7 example with the canonical
anthropic/claude-sonnet-4-6, and correct the env-var casing in the
_resolve_sandbox_image error message to STRIX_IMAGE.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 01:50:50 +00:00

33 lines
1.2 KiB
Python

"""Tests for interface message cleanups.
Covers three cosmetic-correctness fixes:
* dead ``STRIX_REASONING_EFFORT`` branches removed from ``validate_environment``;
* stale ``claude-opus-4-7`` model name replaced with ``claude-sonnet-4-6``;
* ``_resolve_sandbox_image`` reports the env var with correct ``STRIX_IMAGE`` casing.
"""
import inspect
import types
import pytest
from strix.interface import cli
from strix.interface.main import validate_environment, warm_up_llm
def test_reasoning_effort_branches_removed() -> None:
source = inspect.getsource(validate_environment)
assert "STRIX_REASONING_EFFORT" not in source
def test_model_name_uses_sonnet_recommendation() -> None:
source = inspect.getsource(validate_environment) + inspect.getsource(warm_up_llm)
assert "claude-opus-4-7" not in source
assert "claude-sonnet-4-6" in source
def test_resolve_sandbox_image_uses_correct_env_casing(monkeypatch: pytest.MonkeyPatch) -> None:
fake_settings = types.SimpleNamespace(runtime=types.SimpleNamespace(image=""))
monkeypatch.setattr(cli, "load_settings", lambda: fake_settings)
with pytest.raises(RuntimeError, match="STRIX_IMAGE"):
cli._resolve_sandbox_image()