changeset 149:81413c14c5bb

Add tests for _extract_selected_channel with wrong use_channel value
author Amine Sehili <amine.sehili@gmail.com>
date Thu, 21 Feb 2019 20:53:17 +0100
parents 2a1054f9d9f3
children 6c1a11cf9e6a
files tests/test_io.py
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test_io.py	Wed Feb 20 21:17:21 2019 +0100
+++ b/tests/test_io.py	Thu Feb 21 20:53:17 2019 +0100
@@ -279,6 +279,11 @@
         selected_channel = _extract_selected_channel(data, channels, 2, "mix")
         self.assertEqual(selected_channel, expected)
 
+    @genty_dataset(positive=(2,), negative=(-3,))
+    def test_extract_selected_channel_invalid_use_channel(self, use_channel):
+        with self.assertRaises(AudioParameterError):
+            _extract_selected_channel(b"\0\0", 2, 2, use_channel)
+
     @genty_dataset(
         raw_with_audio_format=(
             "audio",