Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jvoisin
mat2
Commits
0354c3b7
Commit
0354c3b7
authored
May 16, 2018
by
jvoisin
Browse files
Add a test about unsupported files
parent
effe68f0
Changes
1
Show whitespace changes
Inline
Side-by-side
tests/test_libmat2.py
View file @
0354c3b7
...
...
@@ -16,6 +16,16 @@ class TestParserFactory(unittest.TestCase):
self
.
assertEqual
(
mimetype
,
'audio/mpeg'
)
self
.
assertEqual
(
parser
.
__class__
,
audio
.
MP3Parser
)
class
TestUnsupportedFiles
(
unittest
.
TestCase
):
def
test_pdf
(
self
):
shutil
.
copy
(
'./tests/test_libmat2.py'
,
'./tests/clean.py'
)
parser
,
mimetype
=
parser_factory
.
get_parser
(
'./tests/data/clean.py'
)
self
.
assertEqual
(
mimetype
,
'text/x-python'
)
self
.
assertEqual
(
parser
,
None
)
os
.
remove
(
'./tests/clean.py'
)
class
TestCorruptedFiles
(
unittest
.
TestCase
):
def
test_pdf
(
self
):
shutil
.
copy
(
'./tests/data/dirty.png'
,
'./tests/data/clean.png'
)
...
...
Write
Preview
Supports
Markdown
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