summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorR. David Murray <rdmurray@bitdance.com>2009-04-29 13:17:37 (GMT)
committerR. David Murray <rdmurray@bitdance.com>2009-04-29 13:17:37 (GMT)
commit25b4add5b0569e626afd8b3b5b7dd4a7551372c9 (patch)
tree8525c0106c36179c66c803754434b9baf001896c /Lib/test
parenta1b91d944beda4a9f1a9ae9a34adbe59c2ad78f5 (diff)
downloadcpython-25b4add5b0569e626afd8b3b5b7dd4a7551372c9.zip
cpython-25b4add5b0569e626afd8b3b5b7dd4a7551372c9.tar.gz
cpython-25b4add5b0569e626afd8b3b5b7dd4a7551372c9.tar.bz2
Fix issue 2245. aifc now skips any chunk type it doesn't actually
process instead of throwing errors for anything not in an explicit skip list. This is per this spec: http://www.cnpbagwell.com/aiff-c.txt. Spec reference and test sound file provided by Santiago Peresón, fix based on patch by Hiroaki Kawai.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/Sine-1000Hz-300ms.aifbin0 -> 61696 bytes
-rw-r--r--Lib/test/test_aifc.py24
-rw-r--r--Lib/test/test_sundry.py1
3 files changed, 24 insertions, 1 deletions
diff --git a/Lib/test/Sine-1000Hz-300ms.aif b/Lib/test/Sine-1000Hz-300ms.aif
new file mode 100644
index 0000000..bf08f5c
--- /dev/null
+++ b/Lib/test/Sine-1000Hz-300ms.aif
Binary files differ
diff --git a/Lib/test/test_aifc.py b/Lib/test/test_aifc.py
new file mode 100644
index 0000000..58380e0
--- /dev/null
+++ b/Lib/test/test_aifc.py
@@ -0,0 +1,24 @@
+from test.test_support import findfile, run_unittest
+import unittest
+
+import aifc
+
+
+class AIFCTest(unittest.TestCase):
+
+ def setUp(self):
+ self.sndfilepath = findfile('Sine-1000Hz-300ms.aif')
+
+ def test_skipunknown(self):
+ #Issue 2245
+ #This file contains chunk types aifc doesn't recognize.
+ f = aifc.open(self.sndfilepath)
+ f.close()
+
+
+def test_main():
+ run_unittest(AIFCTest)
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/Lib/test/test_sundry.py b/Lib/test/test_sundry.py
index 48cbcd6..cef155b 100644
--- a/Lib/test/test_sundry.py
+++ b/Lib/test/test_sundry.py
@@ -11,7 +11,6 @@ class TestUntestedModules(unittest.TestCase):
with warnings.catch_warnings():
warnings.simplefilter("ignore")
import CGIHTTPServer
- import aifc
import audiodev
import bdb
import cgitb