summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_wave.py
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2013-04-10 16:31:43 (GMT)
committerR David Murray <rdmurray@bitdance.com>2013-04-10 16:31:43 (GMT)
commit671cd3290bb046060c8173b5c8294e35fd02ca3d (patch)
treec38b9878549a936519f590f76001eea5fcc881be /Lib/test/test_wave.py
parent3f5ffbee2323770399c9e80cf9c807dc21b3e009 (diff)
downloadcpython-671cd3290bb046060c8173b5c8294e35fd02ca3d.zip
cpython-671cd3290bb046060c8173b5c8294e35fd02ca3d.tar.gz
cpython-671cd3290bb046060c8173b5c8294e35fd02ca3d.tar.bz2
#17487: wave.getparams now returns a namedtuple.
Patch by Claudiu Popa.
Diffstat (limited to 'Lib/test/test_wave.py')
-rw-r--r--Lib/test/test_wave.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/Lib/test/test_wave.py b/Lib/test/test_wave.py
index e0aace4..581d973 100644
--- a/Lib/test/test_wave.py
+++ b/Lib/test/test_wave.py
@@ -58,6 +58,22 @@ class TestWave(unittest.TestCase):
output = b'\0' * nframes * nchannels * sampwidth
self.f.writeframes(output)
+ def test_getparams(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()
+ self.assertEqual(params.nchannels, self.f.getnchannels())
+ self.assertEqual(params.nframes, self.f.getnframes())
+ self.assertEqual(params.sampwidth, self.f.getsampwidth())
+ self.assertEqual(params.framerate, self.f.getframerate())
+ self.assertEqual(params.comptype, self.f.getcomptype())
+ self.assertEqual(params.compname, self.f.getcompname())
+
def test_main():
run_unittest(TestWave)