Skip to content

Commit 6482f19

Browse files
Add unit tests for "parse_popular_response"
1 parent 02e8d4c commit 6482f19

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

test/simplejustwatchapi/test_parser.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
parse_details_response,
55
parse_episodes_response,
66
parse_offers_for_countries_response,
7+
parse_popular_response,
78
parse_search_response,
89
parse_seasons_response,
910
)
@@ -535,6 +536,18 @@ def test_parse_search_response(response_json: dict, expected_output: list[MediaE
535536
assert parsed_entries == expected_output
536537

537538

539+
@mark.parametrize(
540+
argnames=("response_json", "expected_output"),
541+
argvalues=[
542+
(API_SEARCH_RESPONSE_JSON, [PARSED_NODE_1, PARSED_NODE_2, PARSED_NODE_3]),
543+
(API_SEARCH_RESPONSE_NO_DATA, []),
544+
],
545+
)
546+
def test_parse_popular_response(response_json: dict, expected_output: list[MediaEntry]):
547+
parsed_entries = parse_popular_response(response_json)
548+
assert parsed_entries == expected_output
549+
550+
538551
@mark.parametrize(
539552
argnames=("response_json", "expected_output"),
540553
argvalues=[

0 commit comments

Comments
 (0)