Skip to content

Your lightweight open-source personal agent.

test: align test names with current assertions (#6130)

chengyongruf04ed1c2eb43
diff --git a/tests/agent/test_auto_compact.py b/tests/agent/test_auto_compact.py
index 56df53245..e087351af 100644
--- a/tests/agent/test_auto_compact.py
+++ b/tests/agent/test_auto_compact.py
@@ -250,8 +250,8 @@ class TestAgentLoopTTLParam:
loop = _make_loop(tmp_path, session_ttl_minutes=25)
assert loop.auto_compact._ttl == 25
- def test_loop_default_ttl_zero(self, tmp_path):
- """AutoCompact default TTL should be 0 (disabled)."""
+ def test_explicit_zero_ttl_disables_loop_compaction(self, tmp_path):
+ """An explicit zero TTL disables idle compaction in the loop."""
loop = _make_loop(tmp_path, session_ttl_minutes=0)
assert loop.auto_compact._ttl == 0
@@ -1166,7 +1166,7 @@ class TestSummaryPersistence:
await loop.aclose()
@pytest.mark.asyncio
- async def test_metadata_cleanup_on_inmemory_path(self, tmp_path):
+ async def test_inmemory_summary_preserves_metadata_for_restart(self, tmp_path):
"""The in-memory summary path preserves _last_summary for restart recovery."""
loop = _make_loop(tmp_path, session_ttl_minutes=15)
session = loop.sessions.get_or_create("cli:test")
diff --git a/tests/agent/test_consolidator.py b/tests/agent/test_consolidator.py
index 6ddc26156..5b3f59054 100644
--- a/tests/agent/test_consolidator.py
+++ b/tests/agent/test_consolidator.py
@@ -1583,7 +1583,7 @@ class TestCompactIdleSession:
assert not lock.locked()
-class TestRawArchiveTruncation:
+class TestRawArchiveChunks:
"""raw_archive() keeps complete journal content with bounded individual entries."""
@pytest.mark.parametrize("boundary", ["A ", "\n\n", "<think>PRIVATE</think>"])
@@ -1604,7 +1604,7 @@ class TestRawArchiveTruncation:
assert "PRIVATE" not in joined
assert "PUBLIC_TAIL" in joined
- def test_raw_archive_truncates_large_content(self, store):
+ def test_raw_archive_splits_large_content_into_bounded_entries(self, store):
"""Large messages are split across bounded journal entries."""
big = "x" * 50_000
messages = [{"role": "user", "content": big}]
diff --git a/tests/agent/test_loop_image_generation_media.py b/tests/agent/test_loop_image_generation_media.py
index a348d24bd..d45cff499 100644
--- a/tests/agent/test_loop_image_generation_media.py
+++ b/tests/agent/test_loop_image_generation_media.py
@@ -29,11 +29,11 @@ class FakeImageClient:
@pytest.mark.asyncio
-async def test_outbound_no_longer_carries_generated_media(
+async def test_generate_image_does_not_attach_media_to_final_response(
tmp_path: Path,
monkeypatch: pytest.MonkeyPatch,
) -> None:
- """Media delivery is now the LLM's responsibility via the message tool."""
+ """Generating an image does not attach it to the final outbound response."""
set_config_path(tmp_path / "config.json")
monkeypatch.setattr(
"nanobot.agent.tools.image_generation.get_image_gen_provider",
@@ -80,6 +80,5 @@ async def test_outbound_no_longer_carries_generated_media(
assert result is not None
assert result.content == "Done"
- # OutboundMessage no longer carries generated media —
- # the LLM sends images via the message tool instead.
+ # Image delivery requires a separate message tool call.
assert result.media == []
diff --git a/tests/agent/test_loop_progress.py b/tests/agent/test_loop_progress.py
index b609c041f..f3fcc0e10 100644
--- a/tests/agent/test_loop_progress.py
+++ b/tests/agent/test_loop_progress.py
@@ -276,7 +276,7 @@ class TestToolEventProgress:
assert file_events == []
@pytest.mark.asyncio
- async def test_bus_progress_forwards_tool_events_to_outbound_metadata(self, tmp_path: Path) -> None:
+ async def test_bus_progress_delivers_tool_activity_in_progress_events(self, tmp_path: Path) -> None:
"""Bus-dispatched turns deliver tool activity through ProgressEvent.tool_events."""
bus = MessageBus()
provider = MagicMock()
diff --git a/tests/agent/test_loop_runner_integration.py b/tests/agent/test_loop_runner_integration.py
index 65481b267..3410a4ef4 100644
--- a/tests/agent/test_loop_runner_integration.py
+++ b/tests/agent/test_loop_runner_integration.py
@@ -506,7 +506,7 @@ async def test_loop_retries_think_only_final_response(tmp_path):
@pytest.mark.asyncio
-async def test_streamed_flag_not_set_on_llm_error(tmp_path):
+async def test_llm_error_returns_regular_response_instead_of_streamed_event(tmp_path):
"""LLM errors must not produce StreamedResponseEvent, so channels deliver the error."""
from nanobot.agent.loop import AgentLoop
from nanobot.bus.events import InboundMessage
diff --git a/tests/agent/test_onboard_logic.py b/tests/agent/test_onboard_logic.py
index cd2c6b1ff..7a027158e 100644
--- a/tests/agent/test_onboard_logic.py
+++ b/tests/agent/test_onboard_logic.py
@@ -850,8 +850,8 @@ class TestApiServerRegistration:
assert config.api.api_key == "secret"
-class TestMainMenuUpdate:
- """Tests for main menu including new Channel Common and API Server items."""
+class TestMainMenuInteraction:
+ """Main menu navigation, save actions, and terminal input behavior."""
def test_choice_viewport_keeps_long_menus_within_terminal_height(self):
"""Long provider menus should render as a bounded scrolling slice."""
diff --git a/tests/agent/test_runner_fallback.py b/tests/agent/test_runner_fallback.py
index e567afab0..701a955e3 100644
--- a/tests/agent/test_runner_fallback.py
+++ b/tests/agent/test_runner_fallback.py
@@ -1617,7 +1617,7 @@ class TestFailoverOnAuthenticationError:
factory.assert_called_once_with(fallback_preset)
-class TestNoFallbackOnNonRetryableError:
+class TestFallbackErrorClassification:
@pytest.mark.asyncio
async def test_bad_request(self) -> None:
primary = _FakeProvider(
@@ -1666,7 +1666,7 @@ class TestNoFallbackOnNonRetryableError:
factory.assert_not_called()
@pytest.mark.asyncio
- async def test_timeout(self) -> None:
+ async def test_timeout_triggers_fallback(self) -> None:
primary = _FakeProvider(
"primary",
_make_response("timed out", finish_reason="error", error_kind="timeout"),
diff --git a/tests/agent/test_tool_hint.py b/tests/agent/test_tool_hint.py
index 147b2de35..de6940ec1 100644
--- a/tests/agent/test_tool_hint.py
+++ b/tests/agent/test_tool_hint.py
@@ -262,7 +262,7 @@ class TestToolHintMixedFolding:
class TestToolHintMaxLength:
"""Test max_length parameter controls truncation of tool hints."""
- def test_exec_default_truncates_at_40(self):
+ def test_exec_explicit_max_length_limits_hint(self):
cmd = "cd /very/long/path/to/some/project && npm run build && npm test"
result = _hint([_tc("exec", {"command": cmd})], max_length=40)
assert len(result) <= 50 # "$ " prefix + 40 + ellipsis
diff --git a/tests/agent/tools/test_self_tool.py b/tests/agent/tools/test_self_tool.py
index a83f78f2a..3066abe1c 100644
--- a/tests/agent/tools/test_self_tool.py
+++ b/tests/agent/tools/test_self_tool.py
@@ -300,11 +300,11 @@ class TestModifyBlocked:
# set — free tier (setattr priority)
# ---------------------------------------------------------------------------
-class TestModifyFree:
+class TestRuntimeSettingsAndScratchpad:
@pytest.mark.asyncio
- async def test_modify_existing_attr_setattr(self):
- """Modifying an existing loop attribute should use setattr."""
+ async def test_set_updates_runtime_setting(self):
+ """Set a runtime setting through the runtime-control capability."""
tool = _make_tool()
result = await tool.execute(action="set", key="provider_retry_mode", value="persistent")
assert "Set provider_retry_mode" in result
@@ -395,7 +395,7 @@ class TestModifyFree:
# set — previously BLOCKED/READONLY now open
# ---------------------------------------------------------------------------
-class TestModifyOpen:
+class TestProtectedRuntimeState:
@pytest.mark.asyncio
async def test_modify_tools_blocked(self):
diff --git a/tests/providers/test_custom_thinking_style.py b/tests/providers/test_custom_thinking_style.py
index a539baeed..610d815df 100644
--- a/tests/providers/test_custom_thinking_style.py
+++ b/tests/providers/test_custom_thinking_style.py
@@ -10,7 +10,7 @@ from nanobot.providers.registry import create_dynamic_spec
class TestCustomProviderThinkingStyle:
"""Verify that thinking_style flows from config to ProviderSpec."""
- def test_default_thinking_style_is_empty(self) -> None:
+ def test_default_thinking_style_is_none(self) -> None:
cfg = ProviderConfig()
assert cfg.thinking_style is None
diff --git a/tests/providers/test_litellm_kwargs.py b/tests/providers/test_openai_compat_spec.py
similarity index 99%
rename from tests/providers/test_litellm_kwargs.py
rename to tests/providers/test_openai_compat_spec.py
index 00d93aa8a..529fcad44 100644
--- a/tests/providers/test_litellm_kwargs.py
+++ b/tests/providers/test_openai_compat_spec.py
@@ -2,7 +2,7 @@
Validates that:
- OpenRouter (no strip) keeps model names intact.
-- AiHubMix (strip_model_prefix=True) strips provider prefixes.
+- AiHubMix strips provider prefixes declared by its spec.
- Standard providers pass model names through as-is.
"""
@@ -614,7 +614,7 @@ async def test_openrouter_keeps_model_name_intact() -> None:
@pytest.mark.asyncio
async def test_aihubmix_strips_model_prefix() -> None:
- """AiHubMix strips the provider prefix (strip_model_prefix=True)."""
+ """AiHubMix strips provider prefixes declared by its spec."""
mock_create = AsyncMock(return_value=_fake_chat_response())
spec = find_by_name("aihubmix")
diff --git a/tests/tools/test_read_enhancements.py b/tests/tools/test_read_enhancements.py
index 756618c61..3445b42b2 100644
--- a/tests/tools/test_read_enhancements.py
+++ b/tests/tools/test_read_enhancements.py
@@ -554,7 +554,7 @@ class TestOfficeDocTruncation:
assert "truncated" not in result
-class TestReadDescriptionUpdate:
+class TestReadFileDescription:
def test_description_mentions_documents(self):
tool = ReadFileTool()
diff --git a/tests/tools/test_web_search_tool.py b/tests/tools/test_web_search_tool.py
index 1ed1c56b0..7450c3551 100644
--- a/tests/tools/test_web_search_tool.py
+++ b/tests/tools/test_web_search_tool.py
@@ -707,7 +707,7 @@ async def test_unknown_provider():
@pytest.mark.asyncio
-async def test_default_provider_is_brave(monkeypatch):
+async def test_empty_provider_with_api_key_uses_brave(monkeypatch):
async def mock_get(self, url, **kw):
assert "brave" in url
return _response(json={"web": {"results": []}})