diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2013-11-23 20:26:01 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-11-23 20:26:01 (GMT) |
commit | 3062c9a6c87ff9b480d1eea960efbfc604e4b157 (patch) | |
tree | b31b2fe4839d47d9ca54f171d6adf518cfbffa9d /Lib/test/test_wave.py | |
parent | 2b38fc187c2a764b7608cd262de5a2777a77f4c8 (diff) | |
download | cpython-3062c9a6c87ff9b480d1eea960efbfc604e4b157.zip cpython-3062c9a6c87ff9b480d1eea960efbfc604e4b157.tar.gz cpython-3062c9a6c87ff9b480d1eea960efbfc604e4b157.tar.bz2 |
Issue #19641: Added the audioop.byteswap() function to convert big-endian
samples to little-endian and vice versa.
Diffstat (limited to 'Lib/test/test_wave.py')
-rw-r--r-- | Lib/test/test_wave.py | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/Lib/test/test_wave.py b/Lib/test/test_wave.py index 5be1251..549ca89 100644 --- a/Lib/test/test_wave.py +++ b/Lib/test/test_wave.py @@ -1,6 +1,7 @@ from test.support import TESTFN import unittest from test import audiotests +from audioop import byteswap import sys import wave @@ -46,13 +47,7 @@ class WavePCM16Test(audiotests.AudioWriteTests, E4B50CEB 63440A5A 08CA0A1F 2BBA0B0B 51460E47 8BCB113C B6F50EEA 44150A59 \ """) if sys.byteorder != 'big': - frames = audiotests.byteswap2(frames) - - if sys.byteorder == 'big': - @unittest.expectedFailure - def test_unseekable_incompleted_write(self): - super().test_unseekable_incompleted_write() - + frames = byteswap(frames, 2) class WavePCM24Test(audiotests.AudioWriteTests, @@ -82,7 +77,7 @@ class WavePCM24Test(audiotests.AudioWriteTests, 51486F0E44E1 8BCC64113B05 B6F4EC0EEB36 4413170A5B48 \ """) if sys.byteorder != 'big': - frames = audiotests.byteswap3(frames) + frames = byteswap(frames, 3) class WavePCM32Test(audiotests.AudioWriteTests, @@ -112,12 +107,7 @@ class WavePCM32Test(audiotests.AudioWriteTests, 51486F800E44E190 8BCC6480113B0580 B6F4EC000EEB3630 441317800A5B48A0 \ """) if sys.byteorder != 'big': - frames = audiotests.byteswap4(frames) - - if sys.byteorder == 'big': - @unittest.expectedFailure - def test_unseekable_incompleted_write(self): - super().test_unseekable_incompleted_write() + frames = byteswap(frames, 4) if __name__ == '__main__': |