Skip to content

Commit e7db3ca

Browse files
committed
Started tests #36
1 parent bdcf7ac commit e7db3ca

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

tests/test_plugins/test_letterboxd.py

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import pytest
2+
from plugins.letterboxd import Letterboxd
3+
4+
# Test data as fixtures
5+
@pytest.fixture
6+
def test_lists():
7+
return [
8+
"jf_auto_collect/watchlist",
9+
"jf_auto_collect/likes/films",
10+
"jf_auto_collect/list/test_list/"
11+
]
12+
13+
@pytest.fixture
14+
def test_list_output():
15+
return [
16+
{'title': 'The Godfather', 'media_type': 'movie', 'imdb_id': 'tt0068646', 'release_year': '1972'},
17+
{'title': 'The Godfather Part II', 'media_type': 'movie', 'imdb_id': 'tt0071562', 'release_year': '1974'}
18+
]
19+
20+
# Parametrized test for different lists
21+
@pytest.mark.parametrize("test_list", [
22+
"jf_auto_collect/watchlist",
23+
"jf_auto_collect/likes/films",
24+
"jf_auto_collect/list/test_list/"
25+
])
26+
def test_get_list(test_list, test_list_output):
27+
# Assuming Letterboxd.get_list returns a dictionary with a key "items"
28+
result = Letterboxd.get_list(test_list, {"imdb_id_filter": True})
29+
30+
# Perform the assertion to check if the "items" key matches the expected output
31+
assert result["items"] == test_list_output
32+

0 commit comments

Comments
 (0)