test: tighten image placeholder assertions

This commit is contained in:
Xubin Ren
2026-06-19 14:59:52 +08:00
parent de5e216583
commit 58a14d18dd
+3 -3
View File
@@ -41,7 +41,7 @@ class TestStripImageContent:
assert "/tmp/screenshot.png" not in placeholder assert "/tmp/screenshot.png" not in placeholder
assert "screenshot" not in placeholder assert "screenshot" not in placeholder
# Must clearly indicate the image was not delivered # Must clearly indicate the image was not delivered
assert "not delivered" in placeholder.lower() or "not describe" in placeholder.lower() assert "not delivered" in placeholder.lower()
def test_returns_none_when_no_images(self): def test_returns_none_when_no_images(self):
messages = [ messages = [
@@ -93,7 +93,7 @@ class TestStripImageContent:
result = LLMProvider._strip_image_content(messages) result = LLMProvider._strip_image_content(messages)
assert result is not None assert result is not None
placeholder = result[0]["content"][0]["text"] placeholder = result[0]["content"][0]["text"]
assert "[image" not in placeholder.lower() or "not delivered" in placeholder.lower() assert "not delivered" in placeholder.lower()
def test_preserves_non_image_content(self): def test_preserves_non_image_content(self):
messages = [ messages = [
@@ -148,7 +148,7 @@ class TestStripImageContentInplace:
assert len(content) == 2 assert len(content) == 2
placeholder = content[1]["text"] placeholder = content[1]["text"]
assert "/tmp/photo.jpg" not in placeholder assert "/tmp/photo.jpg" not in placeholder
assert "not delivered" in placeholder.lower() or "not describe" in placeholder.lower() assert "not delivered" in placeholder.lower()
def test_returns_false_when_no_images(self): def test_returns_false_when_no_images(self):
messages = [ messages = [