You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix add_page positioning logic and validation (#13)
* Fix add_page positioning logic and validation
BREAKING CHANGE: Correct insert_after_page parameter behavior:
- insert_after_page=-1 now inserts at END of document (not beginning)
- insert_after_page=0 inserts after first page
- insert_after_page=N inserts after page N
- Negative values < -1 are now rejected with ValueError
Changes:
- Update method documentation and examples
- Add validation for invalid negative positions
- Fix logic for -1 (end insertion) vs specific page positions
- Add comprehensive test for invalid position errors
- Rename test methods to reflect correct behavior
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* Implement correct insertion index logic for add_page method
BREAKING CHANGE: Redesign add_page to use proper insertion index semantics:
Parameter changes:
- insert_after_page → insert_index (renamed parameter)
- insert_index=0: Insert before first page (at beginning)
- insert_index=1: Insert before second page (after first page)
- insert_index=-1: Insert after last page (at end)
Implementation changes:
- Completely rewrite positioning logic for insertion index semantics
- Update method documentation and examples
- Rename and update all test cases to match new behavior
- Add validation for invalid negative positions (< -1)
- Fix API parts construction for correct page insertion
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* Fix line length in test_client.py after rebase
Breaking up long json_data parameter in mock assertion call to meet
line length requirements.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
---------
Co-authored-by: Claude <[email protected]>
0 commit comments