Update tests

This commit is contained in:
Patrick Elmer 2023-02-06 16:29:06 +09:00
parent 38e3661dc5
commit 603b049ec8

View File

@ -3,21 +3,17 @@ import re
from soundchanger.change import apply from soundchanger.change import apply
def test_error_in_change(): def test_error_in_change():
# with pytest.raises(ValueError, match=re.escape("Change is not a valid sound change. (Missing character '>')")):
with pytest.raises(ValueError, match=re.escape("Change is not a valid sound change.")): with pytest.raises(ValueError, match=re.escape("Change is not a valid sound change.")):
apply('', '', ignore_errors=False) apply('', '', ignore_errors=False)
def test_error_split(): def test_error_split():
# with pytest.raises(ValueError, match=re.escape("Change a>b/c/d is not a valid sound change. (More than one '/' character)")):
with pytest.raises(ValueError, match=re.escape("Change a>b/c/d is not a valid sound change.")): 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) apply('a>b/c/d', '', ignore_errors=False)
def test_error_in_environment(): def test_error_in_environment():
# with pytest.raises(ValueError, match=re.escape("Environment c is not a valid environment. (Character '_' should exist exactly once)")):
with pytest.raises(ValueError, match=re.escape("Change a>b/c is not a valid sound change.")): with pytest.raises(ValueError, match=re.escape("Change a>b/c is not a valid sound change.")):
apply('a>b/c', '', ignore_errors=False) apply('a>b/c', '', ignore_errors=False)
def test_no_change_from(): def test_no_change_from():
# with pytest.raises(ValueError, match=re.escape("Nothing to change from.")):
with pytest.raises(ValueError, match=re.escape("Change >b is not a valid sound change.")): with pytest.raises(ValueError, match=re.escape("Change >b is not a valid sound change.")):
apply('>b', '', ignore_errors=False) apply('>b', '', ignore_errors=False)