jellyfin-kodi/tests/test_helper_utils.py

19 lines
442 B
Python

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