Repository navigation
Add unit tests for slide compilation and editable PPTX scripts - #4
Closed
devin-ai-integration[bot] wants to merge 1 commit into
Closed
devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Owner
|
Superseded and incorporated into release |
Author
|
❌ Cannot revive Devin session - the session is too old. Please start a new session instead. |
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
The repo had no test suite — all three
scripts/modules were at 0% coverage. This adds unit tests covering the highest-value logic in each, plus a CI workflow to run them.Coverage after this PR:
compile_slide_images_to_pdf.py→ 97%merge_editable_slide_outputs.py→ 95%build_editable_ppt_from_layers.mjs→ pure helpers fully covered (88% branch)Python (
pytest, 55 tests)tests/conftest.pyputsscripts/onsys.pathso the CLI modules import directly. Tests exercise pure helpers (natural_key,parse_size,load_manifest,collect_images,aspect_error,normalize_image,slide_number,extract_texts,find_text_layer/find_page_dir,collect_slide_dirs) plus end-to-end runs ofbuild_pdfand eachmain()using real PIL-generated images and temp dirs — asserting PDF/report output,--strictaspect rejection, and--forceoverwrite behavior.JS (
node:test, 31 tests)The runner was refactored minimally to make functions importable —
main()now only auto-runs when invoked directly, and pure functions are exported:Tests cover arg parsing, style/visibility resolution (
visibleStyleValue,lineFillValue,lineWidthValue,collectTextFillViolations), coordinate math (assetPositioncanvas scaling,pptxScale,toPptxPosition), color normalization, andfindPageDirfilesystem lookup. The backend builders (which need the pptxgenjs / Codex Presentations runtime) are left out intentionally.Tooling
pyproject.toml— pytest config (testpaths = ["tests"])requirements-dev.txt— pytest + pytest-covpackage.json—npm test/npm run test:coverage.github/workflows/tests.yml— runs both suites on push/PR.gitignore— coverage artifactsRun locally:
pytestandnpm test.Link to Devin session: https://app.devin.ai/sessions/1be4e51064554956b8a57786e86ff394
Requested by: @qybaihe