Skip to content

Commit bc96643

Browse files
committed
- Add test for video_search command;
- Add updates to some test files; - created conftest file
1 parent bd78a70 commit bc96643

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

tests/commands/test_video_search.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,19 @@
22
import pytest
33

44
from io import StringIO
5-
<<<<<<< HEAD
65
from unittest.mock import Mock
7-
=======
8-
from unittest.mock import Mock, call
9-
>>>>>>> 0e02e77 (- Add test for video_search command;)
6+
107
from datetime import datetime
118

129
from youtool.commands.video_search import VideoSearch
1310

1411

1512
def test_video_search_string_output(mocker, videos_ids, videos_urls):
16-
<<<<<<< HEAD
1713
"""Test the execution of the video-search command and verify the output as string.
1814
1915
This test simulates the execution of the `VideoSearch.execute` command with a list of video IDs and URLs,
2016
and checks if the output is correctly formatted as a CSV string.
2117
"""
22-
=======
23-
>>>>>>> 0e02e77 (- Add test for video_search command;)
2418
youtube_mock = mocker.patch("youtool.commands.video_search.YouTube")
2519
expected_videos_infos = [
2620
{
@@ -43,14 +37,11 @@ def test_video_search_string_output(mocker, videos_ids, videos_urls):
4337

4438

4539
def test_video_search_file_output(mocker, videos_ids, videos_urls, tmp_path):
46-
<<<<<<< HEAD
4740
"""Test the execution of the video-search command and verify the output to a file.
4841
4942
This test simulates the execution of the `VideoSearch.execute` command with a list of video IDs and URLs,
5043
and checks if the output is correctly written to a CSV file.
5144
"""
52-
=======
53-
>>>>>>> 0e02e77 (- Add test for video_search command;)
5445
youtube_mock = mocker.patch("youtool.commands.video_search.YouTube")
5546
expected_videos_infos = [
5647
{
@@ -82,7 +73,6 @@ def test_video_search_file_output(mocker, videos_ids, videos_urls, tmp_path):
8273

8374

8475
def test_video_search_no_id_and_url_error():
85-
<<<<<<< HEAD
8676
"""Test if the video-search command raises an exception when neither IDs nor URLs are provided.
8777
8878
This test checks if executing the `VideoSearch.execute` command without providing IDs or URLs
@@ -91,7 +81,6 @@ def test_video_search_no_id_and_url_error():
9181
Assertions:
9282
- Assert that the raised exception matches the expected error message.
9383
"""
94-
=======
95-
>>>>>>> 0e02e77 (- Add test for video_search command;)
84+
9685
with pytest.raises(Exception, match="Either 'ids' or 'urls' must be provided"):
9786
VideoSearch.execute(ids=None, urls=None)

0 commit comments

Comments
 (0)