soundchanger/tests/test_change_errors.py

16 lines
634 B
Python

import pytest
import re
from soundchanger.change import apply
def test_parse_change_error_change():
with pytest.raises(ValueError, match=re.escape("Change is not a valid sound change. (Missing character '>')")):
apply('', '')
def test_apply_error_split():
with pytest.raises(ValueError, match=re.escape("Change a>b/c/d is not a valid sound change. (More than one '/' character)")):
apply('a>b/c/d', '')
def test_apply_error_environment():
with pytest.raises(ValueError, match=re.escape("Environment c is not a valid environment. (Character '_' should exist exactly once)")):
apply('a>b/c', '')