Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
jvoisin
mat2
Commits
58a1563a
Commit
58a1563a
authored
Nov 06, 2020
by
jvoisin
Browse files
Better test of corrupted MSOffice files
parent
f6381680
Pipeline
#48807
failed with stages
in 27 seconds
Changes
2
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
3 deletions
+2
-3
tests/data/malformed_content_types.docx
tests/data/malformed_content_types.docx
+0
-0
tests/test_corrupted_files.py
tests/test_corrupted_files.py
+2
-3
No files found.
tests/data/malformed_content_types.docx
View file @
58a1563a
No preview for this file type
tests/test_corrupted_files.py
View file @
58a1563a
...
...
@@ -89,9 +89,8 @@ class TestExplicitelyUnsupportedFiles(unittest.TestCase):
class
TestWrongContentTypesFileOffice
(
unittest
.
TestCase
):
def
test_office_incomplete
(
self
):
shutil
.
copy
(
'./tests/data/malformed_content_types.docx'
,
'./tests/data/clean.docx'
)
p
=
office
.
MSOfficeParser
(
'./tests/data/clean.docx'
)
self
.
assertIsNotNone
(
p
)
self
.
assertFalse
(
p
.
remove_all
())
with
self
.
assertRaises
(
ValueError
):
office
.
MSOfficeParser
(
'./tests/data/clean.docx'
)
os
.
remove
(
'./tests/data/clean.docx'
)
def
test_office_broken
(
self
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment