# HG changeset patch # User Amine Sehili # Date 1550263662 -3600 # Node ID 01ef241d17e644dce4fa8e2903f949be85577de3 # Parent 95203e47e278715b33ecc4fce86169eee0642cd2 Add test for to_file when pydub is not installed diff -r 95203e47e278 -r 01ef241d17e6 tests/test_io.py --- 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")