Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
strass
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hub
strass
Merge requests
!254
add test that would have highlighted
#189
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
add test that would have highlighted
#189
safe-pdf-iter
into
master
Overview
0
Commits
1
Pipelines
1
Changes
1
Merged
Bryan BRANCOTTE
requested to merge
safe-pdf-iter
into
master
2 months ago
Overview
0
Commits
1
Pipelines
1
Changes
1
Expand
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
932b3af9
1 commit,
2 months ago
1 file
+
11
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
src/strass/strass_app/tests/test_sanitize_pdf.py
+
11
−
1
Options
import
os
from
io
import
StringIO
from
io
import
BytesIO
from
pypdf
import
PdfWriter
from
strass_app
import
utils
from
strass_app.tests.test_base_test_case
import
TooledTestCase
@@ -21,3 +23,11 @@ class SafePDFTestCase(TooledTestCase):
cv
.
seek
(
0
)
my_io
=
utils
.
safe_pdf
(
cv
)
self
.
check_no_js
(
my_io
)
def
test_binary_file_indirect_object_iter
(
self
):
writer
=
PdfWriter
()
writer
.
add_attachment
(
"
test.txt
"
,
b
"
content
"
)
stream
=
BytesIO
()
writer
.
write
(
stream
)
my_io
=
utils
.
safe_pdf
(
stream
)
self
.
check_no_js
(
my_io
)
Loading