# HG changeset patch # User Amine Sehili # Date 1834499448 -3600 # Node ID fae263792c2e33ff299f2c2bc7d5d8ccb58661b2 # Parent 5ff29f28637404732da07916571c98832ad4e532 Add tests for _normalize_use_channel diff -r 5ff29f286374 -r fae263792c2e tests/test_io.py --- a/tests/test_io.py Mon Feb 18 20:42:10 2019 +0100 +++ b/tests/test_io.py Fri Feb 18 16:10:48 2028 +0100 @@ -13,6 +13,7 @@ BufferAudioSource, check_audio_data, _guess_audio_format, + _normalize_use_channel, _get_audio_parameters, _array_to_bytes, _mix_audio_channels, @@ -115,6 +116,18 @@ self.assertEqual(result, expected) @genty_dataset( + none=(None, 0), + positive_int=(1, 1), + negative_int=(-1, -1), + left=("left", 0), + right=("right", 1), + mix=("mix", "mix"), + ) + def test_normalize_use_channel(self, use_channel, expected): + result = _normalize_use_channel(use_channel) + self.assertEqual(result, expected) + + @genty_dataset( mono_1byte=([400], 1), stereo_1byte=([400, 600], 1), three_channel_1byte=([400, 600, 2400], 1),