summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-07-13 23:31:11 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2010-07-13 23:31:11 (GMT)
commit94ee95951dce510504c8840d830a9b10b74b16fe (patch)
tree8a69606c0c925b36abef9cb80b9630c896eb8009 /Lib
parent964ee2669e8c35b6c98c2275ccb981a46c57e85d (diff)
downloadcpython-94ee95951dce510504c8840d830a9b10b74b16fe.zip
cpython-94ee95951dce510504c8840d830a9b10b74b16fe.tar.gz
cpython-94ee95951dce510504c8840d830a9b10b74b16fe.tar.bz2
Add missing file from the previous commit (r82859): test_sndhdr.py
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_sndhdr.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/Lib/test/test_sndhdr.py b/Lib/test/test_sndhdr.py
new file mode 100644
index 0000000..1004688
--- /dev/null
+++ b/Lib/test/test_sndhdr.py
@@ -0,0 +1,23 @@
+import sndhdr
+import unittest
+from test.support import findfile
+
+class TestFormats(unittest.TestCase):
+ def test_data(self):
+ for filename, expected in (
+ ('sndhdr.8svx', ('8svx', 0, 1, 0, 8)),
+ ('sndhdr.aifc', ('aifc', 44100, 2, 5, 16)),
+ ('sndhdr.aiff', ('aiff', 44100, 2, 5, 16)),
+ ('sndhdr.au', ('au', 44100, 2, 5.0, 16)),
+ ('sndhdr.hcom', ('hcom', 22050.0, 1, -1, 8)),
+ ('sndhdr.sndt', ('sndt', 44100, 1, 5, 8)),
+ ('sndhdr.voc', ('voc', 0, 1, -1, 8)),
+ ('sndhdr.wav', ('wav', 44100, 2, -1, 16)),
+ ):
+ filename = findfile(filename, subdir="sndhdrdata")
+ what = sndhdr.what(filename)
+ self.assertNotEqual(what, None, filename)
+ self.assertSequenceEqual(what, expected)
+
+if __name__ == '__main__':
+ unittest.main()