blob: 10046887d7059d0aa4bfaaf53c92588730ff8b71 [file] [log] [blame]
Victor Stinnere9ebde42010-07-13 23:04:56 +00001import sndhdr
2import unittest
3from test.support import findfile
4
5class TestFormats(unittest.TestCase):
6 def test_data(self):
7 for filename, expected in (
8 ('sndhdr.8svx', ('8svx', 0, 1, 0, 8)),
9 ('sndhdr.aifc', ('aifc', 44100, 2, 5, 16)),
10 ('sndhdr.aiff', ('aiff', 44100, 2, 5, 16)),
11 ('sndhdr.au', ('au', 44100, 2, 5.0, 16)),
12 ('sndhdr.hcom', ('hcom', 22050.0, 1, -1, 8)),
13 ('sndhdr.sndt', ('sndt', 44100, 1, 5, 8)),
14 ('sndhdr.voc', ('voc', 0, 1, -1, 8)),
15 ('sndhdr.wav', ('wav', 44100, 2, -1, 16)),
16 ):
17 filename = findfile(filename, subdir="sndhdrdata")
18 what = sndhdr.what(filename)
19 self.assertNotEqual(what, None, filename)
20 self.assertSequenceEqual(what, expected)
21
22if __name__ == '__main__':
23 unittest.main()