Skip to content
Snippets Groups Projects
Commit e81ce6cd authored by Julien (jvoisin) Voisin's avatar Julien (jvoisin) Voisin
Browse files

Fix and add a test for explicitly non-supported formats

parent 63365437
No related branches found
No related tags found
No related merge requests found
#!/bin/env python3
# A set of extension that aren't supported, despite matching a supported mimetype
unsupported_extensions = set(['bat', 'c', 'h', 'ksh', 'pl', 'txt', 'asc',
'text', 'pot', 'brf', 'srt', 'rdf', 'wsdl',
'xpdl', 'xsl', 'xsd'])
unsupported_extensions = {
'.asc',
'.bat',
'.brf',
'.c',
'.h',
'.ksh',
'.pl',
'.pot',
'.rdf',
'.srt',
'.text',
'.txt',
'.wsdl',
'.xpdl',
'.xsd',
'.xsl',
}
......@@ -35,6 +35,14 @@ class TestUnsupportedFiles(unittest.TestCase):
self.assertEqual(parser, None)
os.remove('./tests/clean.py')
class TestExplicitelyUnsupportedFiles(unittest.TestCase):
def test_pdf(self):
shutil.copy('./tests/test_libmat2.py', './tests/clean.txt')
parser, mimetype = parser_factory.get_parser('./tests/data/clean.txt')
self.assertEqual(mimetype, 'text/plain')
self.assertEqual(parser, None)
os.remove('./tests/clean.txt')
class TestCorruptedFiles(unittest.TestCase):
def test_pdf(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment