Merged revisions 77459 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r77459 | benjamin.peterson | 2010-01-12 21:49:50 -0600 (Tue, 12 Jan 2010) | 1 line

  use floor division where needed #7681
........
This commit is contained in:
Benjamin Peterson 2010-01-13 03:53:14 +00:00
parent fae34df767
commit 109d3ab2c8
3 changed files with 15 additions and 2 deletions

View file

@ -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)