]> git.parisson.com Git - timeside.git/commitdiff
tests/testdecoding.py: add two more tests with mono and 32kHz files
authorPaul Brossier <piem@piem.org>
Thu, 17 Jan 2013 15:54:00 +0000 (09:54 -0600)
committerPaul Brossier <piem@piem.org>
Thu, 17 Jan 2013 15:54:00 +0000 (09:54 -0600)
tests/testdecoding.py

index 6e0c175899bef1084f2b9c5c97639238a9795ccc..ecc6e70f6ed7a24ca5e27a03894155e3cf91ecf4 100644 (file)
@@ -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):