35 lines
993 B
Python
35 lines
993 B
Python
from soundchanger.change import split_change
|
|
import pytest
|
|
|
|
|
|
def test_simple_change():
|
|
assert split_change('a>b') == ('a', 'b', '', '')
|
|
|
|
def test_change_with_slash():
|
|
assert split_change('a>b/') == ('a', 'b', '', '')
|
|
|
|
def test_change_with_environment():
|
|
assert split_change('a>b/c_d') == ('a', 'b', 'c', 'd')
|
|
|
|
def test_change_with_environment_double_underscore():
|
|
assert split_change('a>b/c__d') == ('a', 'b', 'c', 'd')
|
|
|
|
def test_change_with_environment_before():
|
|
assert split_change('a>b/#_') == ('a', 'b', '#', '')
|
|
|
|
def test_change_with_environment_after():
|
|
assert split_change('a>b/_#') == ('a', 'b', '', '#')
|
|
|
|
def test_change_with_empty_environment():
|
|
assert split_change('a>b/_') == ('a', 'b', '', '')
|
|
|
|
def test_change_to_nothing():
|
|
assert split_change('a>') == ('a', '', '', '')
|
|
|
|
def test_change_to_zero():
|
|
assert split_change('a>-') == ('a', '-', '', '')
|
|
|
|
def test_invalid_input():
|
|
with pytest.raises(ValueError):
|
|
assert split_change('')
|