Add tests for encoders

and some refactoring
This commit is contained in:
Ritiek Malhotra
2020-03-17 17:58:44 +05:30
parent 29005f24ed
commit dae76a0abb
12 changed files with 210 additions and 21 deletions

View File

@@ -1,5 +1,5 @@
from spotdl.encode import EncoderBase
# from spotdl.encode import exceptions
from spotdl.encode.exceptions import FFmpegNotFoundError
from spotdl.encode.encoders import EncoderFFmpeg
import pytest
@@ -9,6 +9,10 @@ class TestEncoderFFmpeg:
def test_subclass(self):
assert issubclass(EncoderFFmpeg, EncoderBase)
def test_ffmpeg_not_found_error(self):
with pytest.raises(FFmpegNotFoundError):
EncoderFFmpeg(encoder_path="/a/nonexistent/path")
class TestEncodingDefaults:
def m4a_to_mp3_encoder(input_file, output_file):