From ccf16d748992b3e7061d1876c46f9a5ce9641907 Mon Sep 17 00:00:00 2001 From: jvoisin <julien.voisin@dustri.org> Date: Tue, 3 Apr 2018 23:29:34 +0200 Subject: [PATCH] Add a test for an issue highligthed by 76f25212d1eef99c360b0a50cd5b88c117acf278 --- tests/test_libmat2.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/test_libmat2.py b/tests/test_libmat2.py index b52e8ce..34eea49 100644 --- a/tests/test_libmat2.py +++ b/tests/test_libmat2.py @@ -8,6 +8,13 @@ import tempfile from src import pdf, images, audio, office, parser_factory +class TestParserFactory(unittest.TestCase): + def test_subsubcalss(self): + """ Test that our module auto-detection is handling sub-sub-classes """ + parser, mimetype = parser_factory.get_parser('./tests/data/dirty.mp3') + self.assertEqual(mimetype, 'audio/mpeg') + self.assertEqual(parser.__class__, audio.MP3Parser) + class TestGetMeta(unittest.TestCase): def test_pdf(self): p = pdf.PDFParser('./tests/data/dirty.pdf') -- GitLab