Handle empty files in profile video XMLs

This commit is contained in:
Odd Stråbø 2020-09-03 22:36:34 +02:00
parent 52bb733254
commit ee7672a0a1
2 changed files with 61 additions and 16 deletions

View file

@ -0,0 +1,18 @@
import sys
import pytest
sys.path.insert(0, 'jellyfin_kodi')
from helper.utils import values # noqa: E402
item1 = {'foo': 123, 'bar': 456, 'baz': 789}
@pytest.mark.parametrize("item,keys,expected", [
(item1, ['{foo}', '{baz}'], [123, 789]),
(item1, ['{foo}', 'bar'], [123, 'bar']),
(item1, ['{foo}', 'bar', 321], [123, 'bar', 321]),
])
def test_values(item, keys, expected):
assert list(values(item, keys)) == expected