[ContentUnderstanding] Tighten test assertions in test_sample_analyze_binary.py and test_sample_analyze_url.py#45791
Open
Copilot wants to merge 3 commits intochangjian-wang/add-contentrange-samples-doc-audio-videofrom
Conversation
…_sample_analyze_url.py Co-authored-by: changjian-wang <15209050+changjian-wang@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] [ContentUnderstanding] Add ContentRange samples for document, video, and audio
[ContentUnderstanding] Tighten test assertions in test_sample_analyze_binary.py and test_sample_analyze_url.py
Mar 19, 2026
changjian-wang
approved these changes
Mar 19, 2026
…' into copilot/sub-pr-45679
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.
Test helper methods used soft
if-guarded checks instead of hard assertions, and content range tests lacked precise boundary checks. This replaces defensive patterns with direct assertions throughout.Helper method improvements (both files)
_test_markdown_extraction: removed softif markdown:guard; addedisinstance(content, DocumentContent)type check; assertscontent.markdownis non-empty_test_document_properties: replacedgetattr(..., None)+if field:patterns with direct attribute access on Required fields (mime_type,start_page_number,end_page_number); addedisinstancechecktest_sample_analyze_url.py— AV/audio helpers_test_audiovisual_properties/_test_audio_properties: addedisinstance(content, AudioVisualContent); hard assertions on Required fieldsstart_time_ms/end_time_ms; tightened end-time check toend_time_ms > start_time_ms; direct markdown assertiontest_sample_analyze_binary.py— content range precisionpages is not None; assertslen(pages) == end_page_number"3-":== full_page_count - 2(was> 0); addedstart_page_number == 3,end_page_number == full_page_count"1-3,5,9-": addedstart_page_number == 1,end_page_number == full_page_count"1,3-4":== 3(was>= 2); addedend_page_number == 4💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.