@@ -31,12 +31,7 @@ def test_filter_fields():
3131 assert filtered_info == expected_result , f"Expected { expected_result } , but got { filtered_info } "
3232
3333
34- def test_channel_ids_from_urls_and_usernames (mocker , channels_urls ):
35- """Test to verify fetching channel IDs from both URLs and usernames.
36-
37- This test checks if the `execute` method of the `ChannelInfo` class correctly fetches channel IDs
38- from a list of URLs and usernames, and then calls the `channels_infos` method with these IDs.
39- """
34+ def test_channel_ids_from_urls_and_usernames (mocker ):
4035 urls = ["https://www.youtube.com/@Turicas/featured" , "https://www.youtube.com/c/PythonicCaf%C3%A9" ]
4136 usernames = ["Turicas" , "PythonicCafe" ]
4237
@@ -52,14 +47,12 @@ def test_channel_ids_from_urls_and_usernames(mocker, channels_urls):
5247 youtube_mock .return_value .channel_id_from_username = channel_id_from_username_mock
5348 youtube_mock .return_value .channels_infos = channels_infos_mock
5449
55- ChannelInfo .execute (urls = channels_urls , usernames = usernames )
50+ ChannelInfo .execute (urls = urls , usernames = usernames )
5651
5752 channel_id_from_url_mock .assert_has_calls (
58- [call (url ) for url in channels_urls ]
53+ [call (url ) for url in urls ]
5954 )
6055 channel_id_from_username_mock .assert_has_calls (
6156 [call (username ) for username in usernames ]
6257 )
63- channels_infos_mock .assert_called_once ()
64- assert ids_from_usernames_mock in channels_infos_mock .call_args .args [0 ]
65- assert ids_from_urls_mock in channels_infos_mock .call_args .args [0 ]
58+ channels_infos_mock .assert_called_once_with ([ids_from_urls_mock , ids_from_usernames_mock ])
0 commit comments