Files
OpenJarvis/tests/cli/test_hints.py
T
Jon Saad-FalconandClaude Opus 4.6 d1d113c1b1 feat(cli): add error hints system
New hints.py with hint_no_config(), hint_no_engine(), hint_no_model().
Wire hint_no_engine into ask.py EngineConnectionError handlers to
show actionable suggestions when engine is unreachable.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 17:27:10 +00:00

38 lines
1.0 KiB
Python

"""Tests for CLI error hint functions."""
from __future__ import annotations
from openjarvis.cli.hints import (
hint_no_config,
hint_no_engine,
hint_no_model,
)
class TestHintFunctions:
def test_hint_no_config_returns_string(self):
msg = hint_no_config()
assert isinstance(msg, str)
assert len(msg) > 0
assert "init" in msg.lower() or "config" in msg.lower()
def test_hint_no_engine_returns_string(self):
msg = hint_no_engine()
assert isinstance(msg, str)
assert len(msg) > 0
assert "engine" in msg.lower() or "ollama" in msg.lower()
def test_hint_no_engine_with_name(self):
msg = hint_no_engine("vllm")
assert "vllm" in msg.lower()
def test_hint_no_model_returns_string(self):
msg = hint_no_model()
assert isinstance(msg, str)
assert len(msg) > 0
assert "model" in msg.lower() or "pull" in msg.lower()
def test_hint_no_model_with_name(self):
msg = hint_no_model("qwen3:8b")
assert "qwen3:8b" in msg