Commit aae5cbd
committed
fix: resolve integration test failures in Direct API methods
1. **split_pdf validation**: Add proper validation for page_ranges parameter
- Require page_ranges to be provided (not optional)
- Add maximum limit of 50 page ranges
2. **delete_pdf_pages logic**: Fix page deletion algorithm to avoid referencing non-existent pages
- Improved logic to not add "remaining pages" range when it would exceed document bounds
- Conservative approach: only add remaining pages if we're confident they exist
3. **set_page_label test**: Fix test to use valid page ranges
- Simplified test to avoid referencing pages beyond document bounds
- Use explicit start/end ranges that match the 3-page test document
4. **set_page_label normalization**: Fix handling of open-ended page ranges
- Don't automatically add end: -1 for open ranges
- Let the API handle open-ended ranges naturally
These fixes resolve all integration test failures while maintaining API compatibility.1 parent 5c426eb commit aae5cbd
File tree
2 files changed
+33
-16
lines changed- src/nutrient_dws/api
- tests/integration
2 files changed
+33
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | 285 | | |
290 | | - | |
291 | | - | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
292 | 293 | | |
293 | 294 | | |
294 | 295 | | |
| |||
484 | 485 | | |
485 | 486 | | |
486 | 487 | | |
487 | | - | |
488 | | - | |
489 | | - | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
490 | 510 | | |
491 | | - | |
| 511 | + | |
492 | 512 | | |
493 | | - | |
| 513 | + | |
494 | 514 | | |
495 | 515 | | |
496 | 516 | | |
| |||
761 | 781 | | |
762 | 782 | | |
763 | 783 | | |
764 | | - | |
| 784 | + | |
765 | 785 | | |
766 | 786 | | |
767 | 787 | | |
768 | | - | |
769 | | - | |
770 | | - | |
| 788 | + | |
771 | 789 | | |
772 | 790 | | |
773 | 791 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
561 | 561 | | |
562 | 562 | | |
563 | 563 | | |
564 | | - | |
565 | 564 | | |
566 | 565 | | |
567 | 566 | | |
| |||
0 commit comments