Add test for split

This commit is contained in:
Timmy Welch 2023-08-03 01:06:10 -07:00
parent 2c3a2566cc
commit 611c40fe0b

View File

@ -218,3 +218,18 @@ urls = [
@pytest.mark.parametrize("value, result", urls)
def test_fix_url(value, result):
assert comictalker.talker_utils.fix_url(value) == result
split = [
(("1,2,,3", ","), ["1", "2", "3"]),
(("1 ,2,,3", ","), ["1", "2", "3"]),
(("1 ,2,,3 ", ","), ["1", "2", "3"]),
(("\n1 \n2\n\n3 ", ","), ["1 \n2\n\n3"]),
(("\n1 \n2\n\n3 ", "\n"), ["1", "2", "3"]),
((None, ","), []),
]
@pytest.mark.parametrize("value, result", split)
def test_split(value, result):
assert comicapi.utils.split(*value) == result