summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2010-01-13 03:49:50 (GMT)
committerBenjamin Peterson <benjamin@python.org>2010-01-13 03:49:50 (GMT)
commit5efea0430caf2c6e066ae2f32e4c28f65d42d69a (patch)
tree49eec9ffecadf8911742b948c763b1b7ffcf447e /Lib/test
parentee5383da5a3c78acb8f4d1fa0898ba8fcbf67e41 (diff)
downloadcpython-5efea0430caf2c6e066ae2f32e4c28f65d42d69a.zip
cpython-5efea0430caf2c6e066ae2f32e4c28f65d42d69a.tar.gz
cpython-5efea0430caf2c6e066ae2f32e4c28f65d42d69a.tar.bz2
use floor division where needed #7681
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_wave.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_wave.py b/Lib/test/test_wave.py
index a7746fd..1bcaa242 100644
--- a/Lib/test/test_wave.py
+++ b/Lib/test/test_wave.py
@@ -1,6 +1,7 @@
from test.support import TESTFN, run_unittest
import os
import wave
+import struct
import unittest
nchannels = 2
@@ -38,6 +39,16 @@ class TestWave(unittest.TestCase):
self.assertEqual(nframes, self.f.getnframes())
self.assertEqual(self.f.readframes(nframes), output)
+ def test_issue7681(self):
+ self.f = wave.open(TESTFN, 'wb')
+ self.f.setnchannels(nchannels)
+ self.f.setsampwidth(sampwidth)
+ self.f.setframerate(framerate)
+ # Don't call setnframes, make _write_header divide to figure it out
+ output = b'\0' * nframes * nchannels * sampwidth
+ self.f.writeframes(output)
+
+
def test_main():
run_unittest(TestWave)