summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_aifc.py
diff options
context:
space:
mode:
authorSandro Tosi <sandro.tosi@gmail.com>2012-01-01 17:04:37 (GMT)
committerSandro Tosi <sandro.tosi@gmail.com>2012-01-01 17:04:37 (GMT)
commitbdd5354700d2ebafc98375ef2982fbcbb42b1ba5 (patch)
treebfd1c9d12e631ab57ad72657c955bbe227a365f1 /Lib/test/test_aifc.py
parentda785fd527f5627cfd8f563fa4ac2c53fd8bfada (diff)
downloadcpython-bdd5354700d2ebafc98375ef2982fbcbb42b1ba5.zip
cpython-bdd5354700d2ebafc98375ef2982fbcbb42b1ba5.tar.gz
cpython-bdd5354700d2ebafc98375ef2982fbcbb42b1ba5.tar.bz2
Issue #13680: add lowecase compression type to write header; patch by Oleg Plakhotnyuk
Diffstat (limited to 'Lib/test/test_aifc.py')
-rw-r--r--Lib/test/test_aifc.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_aifc.py b/Lib/test/test_aifc.py
index 4869bf3..af2305f 100644
--- a/Lib/test/test_aifc.py
+++ b/Lib/test/test_aifc.py
@@ -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)