test: add poml format tests for vision prompts#71
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds comprehensive test coverage for the POML (Prompt Markup Language) format functionality when rendering image content across different output formats. The tests verify that image content is correctly handled and formatted when converting POML markup to various API-specific formats.
- Adds tests for four output formats: dict, pydantic, openai_chat, and langchain
- Verifies correct image handling including base64 encoding, MIME type detection, and metadata preservation
- Ensures proper data structure formatting for each target API format
Comment on lines
+19
to
+22
|
|
||
| def test_poml_format_dict(tmp_path: Path): | ||
| img_path = _create_image(tmp_path) | ||
| markup = f'<p>Image <img src="{img_path}" alt="tiny" syntax="multimedia"/></p>' |
There was a problem hiding this comment.
The markup string is duplicated across all four test functions. Consider extracting this to a shared helper function or fixture to reduce code duplication and make the tests easier to maintain.
Suggested change
| def test_poml_format_dict(tmp_path: Path): | |
| img_path = _create_image(tmp_path) | |
| markup = f'<p>Image <img src="{img_path}" alt="tiny" syntax="multimedia"/></p>' | |
| def _make_markup(img_path: Path) -> str: | |
| return f'<p>Image <img src="{img_path}" alt="tiny" syntax="multimedia"/></p>' | |
| def test_poml_format_dict(tmp_path: Path): | |
| img_path = _create_image(tmp_path) | |
| markup = _make_markup(img_path) |
Co-authored-by: Copilot <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Testing
npm run build-webviewnpm run build-clinpm run lintnpm testpython -m pytest python/testshttps://chatgpt.com/codex/tasks/task_e_689160949998832e8036fdadbc483dc0