From cd0522719005da328a3e0c7230179394d76a840b Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Thu, 17 Jan 2013 09:54:00 -0600 Subject: [PATCH] tests/testdecoding.py: add two more tests with mono and 32kHz files --- tests/testdecoding.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) 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): -- 2.39.5