diff options
author | Yusuke Kadowaki <60080334+yusuke-kadowaki@users.noreply.github.com> | 2022-09-14 13:34:40 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-14 13:34:40 (GMT) |
commit | 92338f8f19dd760b566feb17422a4a4736f171b4 (patch) | |
tree | c5f3eadd753b8ac741e6a27d432d8942ebc008a5 /Lib/test/test_wave.py | |
parent | 4781535a5796838fc4ce88e6e669e8907e426685 (diff) | |
download | cpython-92338f8f19dd760b566feb17422a4a4736f171b4.zip cpython-92338f8f19dd760b566feb17422a4a4736f171b4.tar.gz cpython-92338f8f19dd760b566feb17422a4a4736f171b4.tar.bz2 |
gh-77171 Support WAVE_FORMAT_EXTENSIBLE in the wave module (GH-96777)
The test file, a modified version of Lib/test/audiodata/pluck-pcm24.wav, was provided by Andrea Celletti on the bug tracker.
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Diffstat (limited to 'Lib/test/test_wave.py')
-rw-r--r-- | Lib/test/test_wave.py | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/Lib/test/test_wave.py b/Lib/test/test_wave.py index 0cc94e8..35660fd 100644 --- a/Lib/test/test_wave.py +++ b/Lib/test/test_wave.py @@ -77,6 +77,33 @@ class WavePCM24Test(WaveTest, unittest.TestCase): frames = wave._byteswap(frames, 3) +class WavePCM24ExtTest(WaveTest, unittest.TestCase): + sndfilename = 'pluck-pcm24-ext.wav' + sndfilenframes = 3307 + nchannels = 2 + sampwidth = 3 + framerate = 11025 + nframes = 48 + comptype = 'NONE' + compname = 'not compressed' + frames = bytes.fromhex("""\ + 022D65FFEB9D 4B5A0F00FA54 3113C304EE2B 80DCD6084303 \ + CBDEC006B261 48A99803F2F8 BFE82401B07D 036BFBFE7B5D \ + B85756FA3EC9 B4B055F3502B 299830EBCB62 1A5CA7E6D99A \ + EDFA3EE491BD C625EBE27884 0E05A9E0B6CF EF2929E02922 \ + 5758D8E27067 FB3557E83E16 1377BFEF8402 D82C5BF7272A \ + 978F16FB7745 F5F865FC1013 086635FB9C4E DF30FCFB40EE \ + 117FE0FA3438 3EE6B8FB5AC3 BC77A3FCB2F4 66D6DAFF5F32 \ + CF13B9041275 431D69097A8C C1BB600EC74E 5120B912A2BA \ + EEDF641754C0 8207001664B7 7FFFFF14453F 8000001294E6 \ + 499C1B0EB3B2 52B73E0DBCA0 EFB2B20F5FD8 CE3CDB0FBE12 \ + E4B49C0CEA2D 6344A80A5A7C 08C8FE0A1FFE 2BB9860B0A0E \ + 51486F0E44E1 8BCC64113B05 B6F4EC0EEB36 4413170A5B48 \ + """) + if sys.byteorder != 'big': + frames = wave._byteswap(frames, 3) + + class WavePCM32Test(WaveTest, unittest.TestCase): sndfilename = 'pluck-pcm32.wav' sndfilenframes = 3307 @@ -106,7 +133,8 @@ class WavePCM32Test(WaveTest, unittest.TestCase): class MiscTestCase(unittest.TestCase): def test__all__(self): - support.check__all__(self, wave, not_exported={'WAVE_FORMAT_PCM'}) + not_exported = {'WAVE_FORMAT_PCM', 'WAVE_FORMAT_EXTENSIBLE'} + support.check__all__(self, wave, not_exported=not_exported) class WaveLowLevelTest(unittest.TestCase): |