mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
Issue #13680: add lowecase compression type to write header; patch by Oleg Plakhotnyuk
This commit is contained in:
parent
da785fd527
commit
bdd5354700
2 changed files with 13 additions and 10 deletions
|
@ -1,6 +1,7 @@
|
|||
from test.support import findfile, run_unittest, TESTFN
|
||||
import unittest
|
||||
import os
|
||||
import io
|
||||
|
||||
import aifc
|
||||
|
||||
|
@ -109,6 +110,16 @@ class AIFCTest(unittest.TestCase):
|
|||
f.close()
|
||||
self.assertEqual(testfile.closed, True)
|
||||
|
||||
def test_write_header_comptype_sampwidth(self):
|
||||
for comptype in (b'ULAW', b'ulaw', b'ALAW', b'alaw', b'G722'):
|
||||
fout = self.fout = aifc.open(io.BytesIO(), 'wb')
|
||||
fout.setnchannels(1)
|
||||
fout.setframerate(1)
|
||||
fout.setcomptype(comptype, b'')
|
||||
fout.close()
|
||||
self.assertEqual(fout.getsampwidth(), 2)
|
||||
fout.initfp(None)
|
||||
|
||||
|
||||
def test_main():
|
||||
run_unittest(AIFCTest)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue