censor/Censor
1
37
Fork
You've already forked Censor
3

meta: testing #110

Open
opened 2026年03月02日 22:01:21 +01:00 by mahlzahn · 0 comments
  • python unit tests for basic "backend" functionality using pytest (or unittest)
    • basic utils: History, Redaction, ... → see !112
    • document redaction functionality: Page, Document
      • repeated saving to same path !92 → see !112
      • redaction of certain rectangles: test that underlying text, images and drawings are indeed removed → see !112
      • history, modified state → see !112
    • test redaction with variety of example PDF files
      • full-page redaction
      • no redaction (only elemens outside of page borders must be redacted)
      • test partial-page redaction?
  • integration tests for basic "frontend", e.g.,
    • window title depending on document modified state
    • button visibility and sensibility, e.g., undo/redo depends on past/future history redaction?
  • maybe test file contents after redaction with various independent tools, e.g.,

Test results on sample PDF files

source total no open (safe) fail redact (unsafe, warn) redact too much (safe, warn) fail redact (no warn) broken saving
py-pdf 33 3 2 (draw) 0
qpdf 632 58 4 (draw) 0
pikepdf 35 4 0 0
Artifex 128 5 10 (draw), 1 (txt), 4 (img #165) 1 (img #155)
PyMuPDF 164 1 7 (draw), 4 (img #165) 0
ghostpdl 35 0 3 (draw) 0
poppler 13 1 0 0
openpreserve 293 24 19 (draw), 9 (img) 0 9 (#199) 4 (#198)
total 1,333 96 (7.2%) 64 (4.8%) 1 (0.1%) 9 (0.7%) 4 (0.3%)
- [ ] python unit tests for basic "backend" functionality using `pytest` (or `unittest`) - [x] basic utils: History, Redaction, ... → see !112 - [x] document redaction functionality: Page, Document - [x] repeated saving to same path !92 → see !112 - [x] redaction of certain rectangles: test that underlying text, images and drawings are indeed removed → see !112 - [x] history, modified state → see !112 - [ ] test redaction with variety of example PDF files - [x] full-page redaction - [ ] no redaction (only elemens outside of page borders must be redacted) - [ ] test partial-page redaction? - [ ] integration tests for basic "frontend", e.g., - [ ] window title depending on document modified state - [ ] button visibility and sensibility, e.g., undo/redo depends on past/future history redaction? - [ ] maybe test file contents after redaction with various independent tools, e.g., - [ ] pypdf - [ ] [extract text](https://pypdf.readthedocs.io/en/stable/user/extract-text.html) - [ ] [extract images](https://pypdf.readthedocs.io/en/stable/user/extract-images.html) - [ ] manually check page content stream for painting/text operators to check for vector drawings (like in https://codeberg.org/censor/Censor/pulls/114/files#diff-6dfd2fc9f7b3373d0ef617aef1810049cf1e9487) - pikepdf - poppler ### Test results on sample PDF files - full page redaction with !150, !151, !156, !159, !160, !193 (v0.7.1): source | total | no open (safe) | fail redact (unsafe, warn) | redact too much (safe, warn)|fail redact (no warn)|broken saving --- | --- | --- | --- | --- | --- | --- [py-pdf](https://github.com/py-pdf/sample-files) | 33 | 3 | 2 (draw) | 0 [qpdf](https://github.com/qpdf/qpdf/tree/main/qpdf/qtest) | 632 | 58 | 4 (draw) | 0 [pikepdf](https://github.com/pikepdf/pikepdf/tree/main/tests/resources) | 35 | 4 | 0 | 0 [Artifex](https://github.com/ArtifexSoftware/tests/tree/master/pdf) | 128 | 5 | 10 (draw), 1 (txt), 4 (img #165)| 1 (img #155) [PyMuPDF](https://github.com/pymupdf/PyMuPDF/tree/main/tests/resources) | 164 | 1 | 7 (draw), 4 (img #165)| 0 [ghostpdl](https://github.com/ArtifexSoftware/ghostpdl/tree/master/examples) | 35 | 0 | 3 (draw) | 0 [poppler](https://gitlab.freedesktop.org/poppler/test/-/tree/master/tests) | 13 | 1 | 0 | 0 [openpreserve](https://github.com/openpreserve/format-corpus) | 293 | 24 | 19 (draw), 9 (img) | 0 | 9 (#199) | 4 (#198) **total** |1,333 | 96 (7.2%) | **64 (4.8%)** | 1 (0.1%) | **9 (0.7%)** | **4 (0.3%)**
mahlzahn added reference translate-weblate-censor-censor 2026年04月17日 14:57:31 +02:00
mahlzahn removed reference translate-weblate-censor-censor 2026年04月17日 14:57:38 +02:00
Sign in to join this conversation.
No Branch/Tag specified
main
v0.7.3
v0.7.2
v0.7.1
v0.7.0
v0.6.0
v0.5.0
v0.4.0
v0.3.0
v0.2.0
v0.1.0
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
censor/Censor#110
Reference in a new issue
censor/Censor
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?