23 lines
669 B
Python
23 lines
669 B
Python
from voice_gen.errors import VoiceGenError, VoiceNotFoundError, MmxError
|
|
|
|
|
|
def test_voice_gen_error_is_base_exception():
|
|
err = VoiceGenError("boom")
|
|
assert isinstance(err, Exception)
|
|
assert str(err) == "boom"
|
|
|
|
|
|
def test_voice_not_found_inherits_base():
|
|
err = VoiceNotFoundError("wantsong")
|
|
assert isinstance(err, VoiceGenError)
|
|
assert "wantsong" in str(err)
|
|
|
|
|
|
def test_mmx_error_carries_exit_code_and_stderr():
|
|
err = MmxError(exit_code=3, stderr="auth failed")
|
|
assert isinstance(err, VoiceGenError)
|
|
assert err.exit_code == 3
|
|
assert err.stderr == "auth failed"
|
|
assert "exit=3" in str(err)
|
|
assert "auth failed" in str(err)
|