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
Commits
6e47fd53
Commit
6e47fd53
authored
4 weeks ago
by
Bryan BRANCOTTE
Browse files
Options
Downloads
Plain Diff
Merge branch 'safe-pdf-iter' into 'master'
add test that would have highlighted
#189
See merge request
!254
parents
6b6a8012
932b3af9
No related branches found
No related tags found
1 merge request
!254
add test that would have highlighted #189
Pipeline
#153488
passed
4 weeks ago
Stage: 📦 build
Stage: 🩺 test
Stage: 🚀 deploy
Stage: 🔧 configure
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/strass/strass_app/tests/test_sanitize_pdf.py
+11
-1
11 additions, 1 deletion
src/strass/strass_app/tests/test_sanitize_pdf.py
with
11 additions
and
1 deletion
src/strass/strass_app/tests/test_sanitize_pdf.py
+
11
−
1
View file @
6e47fd53
import
os
import
os
from
io
import
StringIO
from
io
import
BytesIO
from
pypdf
import
PdfWriter
from
strass_app
import
utils
from
strass_app
import
utils
from
strass_app.tests.test_base_test_case
import
TooledTestCase
from
strass_app.tests.test_base_test_case
import
TooledTestCase
...
@@ -21,3 +23,11 @@ class SafePDFTestCase(TooledTestCase):
...
@@ -21,3 +23,11 @@ class SafePDFTestCase(TooledTestCase):
cv
.
seek
(
0
)
cv
.
seek
(
0
)
my_io
=
utils
.
safe_pdf
(
cv
)
my_io
=
utils
.
safe_pdf
(
cv
)
self
.
check_no_js
(
my_io
)
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
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment