From: Paul Brossier Date: Thu, 17 Jan 2013 15:54:00 +0000 (-0600) Subject: tests/testdecoding.py: add two more tests with mono and 32kHz files X-Git-Tag: 0.4.3~2^2~3 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=cd0522719005da328a3e0c7230179394d76a840b;p=timeside.git tests/testdecoding.py: add two more tests with mono and 32kHz files --- diff --git a/tests/testdecoding.py b/tests/testdecoding.py index 6e0c175..ecc6e70 100644 --- a/tests/testdecoding.py +++ b/tests/testdecoding.py @@ -16,6 +16,20 @@ class TestDecoding(TestCase): self.expected_channels = 2 self.expected_samplerate = 44100 + def testWavMono(self): + "Test mono wav decoding" + self.source = os.path.join (os.path.dirname(__file__), "samples/sweep_mono.wav") + + self.expected_channels = 1 + self.expected_samplerate = 44100 + + def testWav32k(self): + "Test 32kHz wav decoding" + self.source = os.path.join (os.path.dirname(__file__), "samples/sweep_32000.wav") + + self.expected_channels = 2 + self.expected_samplerate = 32000 + def testFlac(self): "Test flac decoding" self.source = os.path.join (os.path.dirname(__file__), "samples/sweep.flac") @@ -83,7 +97,10 @@ class TestDecoding(TestCase): elif os.path.splitext(self.source)[-1].lower() == '.ogg': self.assertEquals(totalframes, 352832) else: - self.assertEquals(totalframes, 352800) + if '_32000.wav' in self.source: + self.assertEquals(totalframes, 256000) + else: + self.assertEquals(totalframes, 352800) class TestDecodingStereo(TestDecoding):