[BUGFIX] Remove description from Soundcloud source variables (#114)
* [BUGFIX] Remove description from Soundcloud source variable * update unit tests
This commit is contained in:
parent
12a857bf9a
commit
079994c003
4 changed files with 17 additions and 20 deletions
|
|
@ -177,12 +177,3 @@ class EntryVariables(SourceVariables):
|
||||||
The uploaded date formatted as YYYY-MM-DD
|
The uploaded date formatted as YYYY-MM-DD
|
||||||
"""
|
"""
|
||||||
return f"{self.upload_year}-{self.upload_month_padded}-{self.upload_day_padded}"
|
return f"{self.upload_year}-{self.upload_month_padded}-{self.upload_day_padded}"
|
||||||
|
|
||||||
@property
|
|
||||||
def description(self: BaseEntry) -> str:
|
|
||||||
"""
|
|
||||||
Returns
|
|
||||||
-------
|
|
||||||
The description of the entry.
|
|
||||||
"""
|
|
||||||
return self.kwargs("description")
|
|
||||||
|
|
|
||||||
|
|
@ -91,3 +91,12 @@ class YoutubeVideoVariables(EntryVariables):
|
||||||
The size of the playlist. For non-playlist download strategies, this will always return 1.
|
The size of the playlist. For non-playlist download strategies, this will always return 1.
|
||||||
"""
|
"""
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
@property
|
||||||
|
def description(self: BaseEntry) -> str:
|
||||||
|
"""
|
||||||
|
Returns
|
||||||
|
-------
|
||||||
|
The description of the entry.
|
||||||
|
"""
|
||||||
|
return self.kwargs("description")
|
||||||
|
|
|
||||||
|
|
@ -25,11 +25,6 @@ def title():
|
||||||
return "entry title"
|
return "entry title"
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
|
||||||
def description():
|
|
||||||
return "a description"
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def upload_year():
|
def upload_year():
|
||||||
return 2021
|
return 2021
|
||||||
|
|
@ -79,7 +74,6 @@ def mock_entry_to_dict(
|
||||||
upload_date,
|
upload_date,
|
||||||
upload_year,
|
upload_year,
|
||||||
thumbnail_ext,
|
thumbnail_ext,
|
||||||
description,
|
|
||||||
upload_month,
|
upload_month,
|
||||||
upload_day,
|
upload_day,
|
||||||
):
|
):
|
||||||
|
|
@ -98,14 +92,11 @@ def mock_entry_to_dict(
|
||||||
"upload_day": upload_day,
|
"upload_day": upload_day,
|
||||||
"upload_day_padded": _pad(upload_day),
|
"upload_day_padded": _pad(upload_day),
|
||||||
"thumbnail_ext": thumbnail_ext,
|
"thumbnail_ext": thumbnail_ext,
|
||||||
"description": description,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def mock_entry_kwargs(
|
def mock_entry_kwargs(uid, title, ext, upload_date, extractor, download_thumbnail_name):
|
||||||
uid, title, ext, upload_date, extractor, description, download_thumbnail_name
|
|
||||||
):
|
|
||||||
return {
|
return {
|
||||||
"id": uid,
|
"id": uid,
|
||||||
"extractor": extractor,
|
"extractor": extractor,
|
||||||
|
|
@ -113,7 +104,6 @@ def mock_entry_kwargs(
|
||||||
"ext": ext,
|
"ext": ext,
|
||||||
"upload_date": upload_date,
|
"upload_date": upload_date,
|
||||||
"thumbnail": download_thumbnail_name,
|
"thumbnail": download_thumbnail_name,
|
||||||
"description": description,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,11 @@ from ytdl_sub.entries.soundcloud import SoundcloudTrack
|
||||||
from ytdl_sub.entries.youtube import YoutubeVideo
|
from ytdl_sub.entries.youtube import YoutubeVideo
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture
|
||||||
|
def description():
|
||||||
|
return "a description"
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def playlist_index():
|
def playlist_index():
|
||||||
return 1
|
return 1
|
||||||
|
|
@ -44,6 +49,7 @@ def mock_youtube_video_to_dict(
|
||||||
"track_title_sanitized": track_title,
|
"track_title_sanitized": track_title,
|
||||||
"artist": artist,
|
"artist": artist,
|
||||||
"artist_sanitized": artist,
|
"artist_sanitized": artist,
|
||||||
|
"description": description,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -60,6 +66,7 @@ def mock_youtube_video_kwargs(
|
||||||
"channel": channel,
|
"channel": channel,
|
||||||
"track": track_title,
|
"track": track_title,
|
||||||
"artist": artist,
|
"artist": artist,
|
||||||
|
"description": description,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue