fix(tests): update image placeholder assertions for new non-descriptive text

The _strip_image_content methods now use a fixed non-descriptive
placeholder instead of path-derived text. Update the 3 existing
test_provider_retry assertions to match the new placeholder format.
This commit is contained in:
michaelxer
2026-06-19 14:59:52 +08:00
committed by Xubin Ren
parent 9ed3905a23
commit 7917466f4e
+4 -4
View File
@@ -309,7 +309,7 @@ async def test_non_transient_error_with_images_retries_without_images() -> None:
content = msg.get("content")
if isinstance(content, list):
assert all(b.get("type") != "image_url" for b in content)
assert any("[image: /media/test.png]" in (b.get("text") or "") for b in content)
assert any("not delivered" in (b.get("text") or "").lower() for b in content)
@pytest.mark.asyncio
@@ -327,7 +327,7 @@ async def test_successful_image_retry_mutates_original_messages_in_place() -> No
content = messages[0]["content"]
assert isinstance(content, list)
assert all(block.get("type") != "image_url" for block in content)
assert any("[image: /media/test.png]" in (block.get("text") or "") for block in content)
assert any("not delivered" in (block.get("text") or "").lower() for block in content)
@pytest.mark.asyncio
@@ -362,7 +362,7 @@ async def test_image_fallback_returns_error_on_second_failure() -> None:
@pytest.mark.asyncio
async def test_image_fallback_without_meta_uses_default_placeholder() -> None:
"""When _meta is absent, fallback placeholder is '[image omitted]'."""
"""When _meta is absent, fallback placeholder is non-descriptive."""
provider = ScriptedProvider([
LLMResponse(content="error", finish_reason="error"),
LLMResponse(content="ok"),
@@ -376,7 +376,7 @@ async def test_image_fallback_without_meta_uses_default_placeholder() -> None:
for msg in msgs_on_retry:
content = msg.get("content")
if isinstance(content, list):
assert any("[image omitted]" in (b.get("text") or "") for b in content)
assert any("not delivered" in (b.get("text") or "").lower() for b in content)
@pytest.mark.asyncio