From fc0e3d050fb07ace2669a6c76e2f5f05846e7e88 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Mon, 3 Feb 2014 11:09:04 -0300 Subject: [PATCH] tests/test_decoding.py: check mime_type --- tests/test_decoding.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/test_decoding.py b/tests/test_decoding.py index 203256a..c5459d0 100755 --- a/tests/test_decoding.py +++ b/tests/test_decoding.py @@ -27,6 +27,7 @@ class TestDecoding(unittest.TestCase): self.expected_totalframes = 352800 self.test_exact_duration = True self.source_duration = 8 + self.expected_mime_type = 'audio/x-wav' def testWav(self): "Test wav decoding" @@ -55,6 +56,7 @@ class TestDecoding(unittest.TestCase): "Test flac decoding" self.source = os.path.join(os.path.dirname(__file__), "samples/sweep.flac") + self.expected_mime_type = 'audio/flac' def testOgg(self): "Test ogg decoding" @@ -62,6 +64,7 @@ class TestDecoding(unittest.TestCase): "samples/sweep.ogg") self.expected_totalframes = 352832 + self.expected_mime_type = 'audio/ogg' self.test_exact_duration = False def testMp3(self): @@ -70,6 +73,7 @@ class TestDecoding(unittest.TestCase): "samples/sweep.mp3") self.expected_totalframes = 353664 + self.expected_mime_type = 'audio/mpeg' self.test_exact_duration = False def tearDown(self): @@ -97,6 +101,7 @@ class TestDecoding(unittest.TestCase): print "input / output_channels:", decoder.input_channels, decoder.output_channels print "input_duration:", decoder.input_duration print "input_totalframes:", decoder.input_totalframes + print "mime_type", decoder.mime_type() if self.channels: # when specified, check that the channels are the ones requested @@ -118,6 +123,8 @@ class TestDecoding(unittest.TestCase): self.assertEqual( self.expected_samplerate, decoder.output_samplerate) + self.assertEqual(decoder.mime_type(), self.expected_mime_type) + self.assertEqual(totalframes, self.expected_totalframes) input_duration = decoder.input_totalframes / decoder.input_samplerate output_duration = decoder.totalframes() / decoder.output_samplerate -- 2.39.5