Repository navigation
test(watermark): characterise the current tool before the redesign - #209
Merged
Merged
Conversation
37 tests drive the real TabMarcaDagua through _load_input and _run, with the background work run inline and every modal and file dialog replaced by fail-closed stand-ins. They pin the affected pages, the above/below layer order, the placement measured by rendering on A4, landscape A4, A5, /Rotate 90 and a shifted CropBox, the document structure that is lost (outline, title, page labels, AcroForm, attachments), the output name, the unencrypted output, a multi-page watermark and cancellation. 13 tests carry the new known_defect marker (registered in tests/conftest.py): they characterise known defects that the redesign will change on purpose. A widget census and a top-level window guard make sure a new warning does not go unseen. What is left out is declared in the test itself. No production change. Mutations: 80 entries; 70 killed; 7 survive and are declared as not covered; 2 are controls; 1 hangs by design. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
|---|---|---|---|---|---|
| 38298628 | Triggered | Generic Password | 0e6f509 | tests/test_watermark_characterization.py | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secret safely. Learn here the best practices.
- Revoke and rotate this secret.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
The GitGuardian check on the pull request flagged a "Generic Password" (incident 38298628) in tests/test_watermark_characterization.py, on the line rec = run_tool(src, wm, out=out, src_password=src_pw). The only password literal in the file is "segredo-ç", a parameter that encrypts a PDF generated in tmp_path. The exclusion is per individual file, as the header of .gitguardian.yaml asks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deploying pdfapps with
|
| Latest commit: |
3b7d936
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://7f75844f.pdfapps.pages.dev |
| Branch Preview URL: | https://test-watermark-characterizat.pdfapps.pages.dev |
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
Characterisation tests for the watermark tool (
TabMarcaDagua), written before the redesign so that every behaviour change it makes is deliberate and visible. No production change: the PR adds three files undertests/only.tests/test_watermark_characterization.py: 37 tests that drive the realTabMarcaDaguathrough_load_inputand_run, with the background work run inline and every modal and file dialog replaced by fail-closed stand-ins.tests/_inline_background.py: the helper that runs the background work inline.tests/conftest.py: new and suite-wide. It only registers theknown_defectmarker.The tests pin:
/Rotate 90and a shifted CropBox;13 of the 37 tests carry the new
known_defectmarker: they characterise known defects as they behave today, and the redesign will change them on purpose. List them withpytest -m known_defect.A widget census and a top-level window guard make sure a new warning does not go unseen. What is left out is declared in the test file itself.
Verification
Windows, base
01dcb6a, PyMuPDF 1.28.2 venv,--strict-markers:restore_probeplugin (22 patch targets, 1025 tests), both ordersMutation run, 80 entries, almost all edits to
app/tools/watermark.pyplus a few test-side edits to the harness, each run on a throwaway copy:WSL, Ubuntu 26.04, Python 3.14.4, fresh clone of this branch at
0e6f509, throwaway venv withrequirements.txtandrequirements-dev.txt(pypdf 6.21.0, PyMuPDF 1.28.2, PySide6 6.11.2, pytest 9.1.1),--strict-markers:-m known_defectThe 3 skips are platform skips that already exist (one Windows-only test, two that need DejaVuSans.ttf).
🤖 Generated with Claude Code