mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 17:55:01 +00:00
test: verify image file presence in LLM messages for read-only command
This commit is contained in:
parent
705eb06e8d
commit
309893fd1e
1 changed files with 14 additions and 0 deletions
|
@ -903,6 +903,20 @@ class TestCommands(TestCase):
|
|||
)
|
||||
)
|
||||
|
||||
# Check that the image file appears in the messages
|
||||
messages = vision_coder.format_messages().all_messages()
|
||||
found_image = False
|
||||
for msg in messages:
|
||||
if msg.get("role") == "user" and "content" in msg:
|
||||
content = msg["content"]
|
||||
if isinstance(content, list):
|
||||
for item in content:
|
||||
if isinstance(item, dict) and item.get("type") == "text":
|
||||
if "test_image.jpg" in item.get("text", ""):
|
||||
found_image = True
|
||||
break
|
||||
self.assertTrue(found_image, "Image file not found in messages to LLM")
|
||||
|
||||
def test_cmd_read_only_with_glob_pattern(self):
|
||||
with GitTemporaryDirectory() as repo_dir:
|
||||
io = InputOutput(pretty=False, fancy_input=False, yes=False)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue