mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
use floor division where needed #7681
This commit is contained in:
parent
ee5383da5a
commit
5efea0430c
3 changed files with 15 additions and 2 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue