changeset 139:01ef241d17e6

Add test for to_file when pydub is not installed
author Amine Sehili <amine.sehili@gmail.com>
date Fri, 15 Feb 2019 21:47:42 +0100
parents 95203e47e278
children b5a2da2e61f9
files tests/test_io.py
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test_io.py	Fri Feb 15 20:27:06 2019 +0100
+++ b/tests/test_io.py	Fri Feb 15 21:47:42 2019 +0100
@@ -629,3 +629,8 @@
             to_file(b"\0\0", "audio", audio_format="wav", **params)
         with self.assertRaises(AudioParameterError):
             to_file(b"\0\0", "audio", audio_format="mp3", **params)
+
+    def test_to_file_no_pydub(self):
+        with patch("auditok.io._WITH_PYDUB", False):
+            with self.assertRaises(AudioIOError):
+                to_file("audio", b"", "mp3")