20 lines
750 B
Python
20 lines
750 B
Python
import pytest
|
|
import re
|
|
from soundchanger.change import apply
|
|
|
|
def test_error_in_change():
|
|
with pytest.raises(ValueError, match=re.escape("Change is not a valid sound change.")):
|
|
apply('', '', ignore_errors=False)
|
|
|
|
def test_error_split():
|
|
with pytest.raises(ValueError, match=re.escape("Change a>b/c/d is not a valid sound change.")):
|
|
apply('a>b/c/d', '', ignore_errors=False)
|
|
|
|
def test_error_in_environment():
|
|
with pytest.raises(ValueError, match=re.escape("Change a>b/c is not a valid sound change.")):
|
|
apply('a>b/c', '', ignore_errors=False)
|
|
|
|
def test_no_change_from():
|
|
with pytest.raises(ValueError, match=re.escape("Change >b is not a valid sound change.")):
|
|
apply('>b', '', ignore_errors=False)
|