aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_sndhdr.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_sndhdr.py')
-rw-r--r--Lib/test/test_sndhdr.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/test/test_sndhdr.py b/Lib/test/test_sndhdr.py
index 5e0abe0b363..426417c0382 100644
--- a/Lib/test/test_sndhdr.py
+++ b/Lib/test/test_sndhdr.py
@@ -1,4 +1,5 @@
import sndhdr
+import pickle
import unittest
from test.support import findfile
@@ -18,6 +19,19 @@ class TestFormats(unittest.TestCase):
what = sndhdr.what(filename)
self.assertNotEqual(what, None, filename)
self.assertSequenceEqual(what, expected)
+ self.assertEqual(what.filetype, expected[0])
+ self.assertEqual(what.framerate, expected[1])
+ self.assertEqual(what.nchannels, expected[2])
+ self.assertEqual(what.nframes, expected[3])
+ self.assertEqual(what.sampwidth, expected[4])
+
+ def test_pickleable(self):
+ filename = findfile('sndhdr.aifc', subdir="sndhdrdata")
+ what = sndhdr.what(filename)
+ for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+ dump = pickle.dumps(what, proto)
+ self.assertEqual(pickle.loads(dump), what)
+
if __name__ == '__main__':
unittest.main()