test(bedrock): add regression test for cachePoint as separate block #1570
+26
−0
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
Add regression test to verify that
cachePointcontent blocks are correctly formatted as standalone blocks (not merged into previous content blocks).This test confirms that the fix from PR #1438 works correctly for the scenario reported in Issue #1219, where
cachePointblocks followingtextblocks were causingValidationExceptionerrors.What this PR does:
test_format_request_cachepoint_after_text_separate_blocksthat verifies:cachePointblocks remain as separate content blocksBackground
Issue #1219 reported that
cachePointblocks after text/document content causedValidationException. This was already fixed by PR #1438 (which added propercachePointhandling in_format_request_message_content).This PR adds a regression test to ensure the fix continues to work.
Test plan
test_format_request_cachepoint_after_text_separate_blockshatch test tests/strands/models/test_bedrock.py::test_format_request_cachepoint_after_text_separate_blocksCloses #1219
🤖 Generated with Claude Code