summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_audioop.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-01-03 02:26:47 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2014-01-03 02:26:47 (GMT)
commitdaeffd2c08f8a04818b99e8342da79cf98ab730a (patch)
tree93805c11894dff76c9bc616380ba5f93e1937add /Lib/test/test_audioop.py
parent6f055e73df0846dcfed12704db9d17098f03d652 (diff)
downloadcpython-daeffd2c08f8a04818b99e8342da79cf98ab730a.zip
cpython-daeffd2c08f8a04818b99e8342da79cf98ab730a.tar.gz
cpython-daeffd2c08f8a04818b99e8342da79cf98ab730a.tar.bz2
audioop: adpcm2lin() and lin2adpcm() now raises a TypeError instead of a
SystemError if the state type is invalid.
Diffstat (limited to 'Lib/test/test_audioop.py')
-rw-r--r--Lib/test/test_audioop.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_audioop.py b/Lib/test/test_audioop.py
index d507545..879adea 100644
--- a/Lib/test/test_audioop.py
+++ b/Lib/test/test_audioop.py
@@ -269,6 +269,11 @@ class TestAudioop(unittest.TestCase):
self.assertEqual(audioop.lin2adpcm(b'\0' * w * 10, w, None),
(b'\0' * 5, (0, 0)))
+ def test_invalid_adpcm_state(self):
+ # state must be a tuple or None, not an integer
+ self.assertRaises(TypeError, audioop.adpcm2lin, b'\0', 1, 555)
+ self.assertRaises(TypeError, audioop.lin2adpcm, b'\0', 1, 555)
+
def test_lin2alaw(self):
self.assertEqual(audioop.lin2alaw(datas[1], 1),
b'\xd5\x87\xa4\x24\xaa\x2a\x5a')