Issue #13680: add lowecase compression type to write header; patch by Oleg Plakhotnyuk

This commit is contained in:
Sandro Tosi 2012-01-01 18:04:37 +01:00
parent da785fd527
commit bdd5354700
2 changed files with 13 additions and 10 deletions

View file

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