summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_wave.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_wave.py')
-rw-r--r--Lib/test/test_wave.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/test_wave.py b/Lib/test/test_wave.py
index b70f917..30dca90b 100644
--- a/Lib/test/test_wave.py
+++ b/Lib/test/test_wave.py
@@ -1,5 +1,6 @@
from test.support import TESTFN, unlink
import wave
+import pickle
import unittest
nchannels = 2
@@ -69,6 +70,18 @@ class TestWave(unittest.TestCase):
self.assertEqual(params.comptype, self.f.getcomptype())
self.assertEqual(params.compname, self.f.getcompname())
+ def test_getparams_picklable(self):
+ self.f = wave.open(TESTFN, 'wb')
+ self.f.setnchannels(nchannels)
+ self.f.setsampwidth(sampwidth)
+ self.f.setframerate(framerate)
+ self.f.close()
+
+ self.f = wave.open(TESTFN, 'rb')
+ params = self.f.getparams()
+ dump = pickle.dumps(params)
+ self.assertEqual(pickle.loads(dump), params)
+
def test_wave_write_context_manager_calls_close(self):
# Close checks for a minimum header and will raise an error
# if it is not set, so this proves that close is called.