fix tests and backwards source/playlist

This commit is contained in:
Jesse Bannon 2022-09-17 00:42:40 -07:00
parent 600adcf0a8
commit 9778afdc4c
3 changed files with 14 additions and 10 deletions

View file

@ -69,7 +69,7 @@ class EntryParent(BaseEntry):
def _parent_variables(self, parent_type: str) -> Dict:
def _(source_key: str, playlist_key: str) -> str:
return playlist_key if parent_type == ParentType.SOURCE else source_key
return playlist_key if parent_type == ParentType.PLAYLIST else source_key
return {
_(SOURCE_ENTRY, PLAYLIST_ENTRY): self._kwargs,

View file

@ -64,6 +64,7 @@ def mock_entry_to_dict(
"title": "entry title",
"title_sanitized": "entry title",
"ext": ext,
"description": "",
"extractor": extractor,
"upload_date": upload_date,
"upload_date_standardized": "2021-01-12",
@ -85,12 +86,22 @@ def mock_entry_to_dict(
"thumbnail_ext": thumbnail_ext,
"info_json_ext": "info.json",
"webpage_url": webpage_url,
"playlist": "entry title",
"playlist_sanitized": "entry title",
"playlist_index": 1,
"playlist_index_padded": "01",
"playlist_count": 1,
"playlist_max_upload_year": 2021,
"playlist_max_upload_year_truncated": 21,
"playlist_title": "entry title",
"playlist_title_sanitized": "entry title",
"playlist_description": "",
"playlist_webpage_url": "https://yourname.here",
"source_count": 1,
"source_description": "",
"source_index": 1,
"source_index_padded": "01",
"source_title": "entry title",
"source_title_sanitized": "entry title",
"source_webpage_url": "https://yourname.here",
}

View file

@ -4,11 +4,6 @@ from ytdl_sub.entries.soundcloud import SoundcloudTrack
from ytdl_sub.entries.youtube import YoutubeVideo
@pytest.fixture
def description():
return "a description"
@pytest.fixture
def playlist_index():
return 1
@ -49,7 +44,6 @@ def mock_youtube_video_to_dict(
"track_title_sanitized": track_title,
"artist": artist,
"artist_sanitized": artist,
"description": description,
}
)
@ -66,7 +60,6 @@ def mock_youtube_video_kwargs(
"channel": channel,
"track": track_title,
"artist": artist,
"description": description,
}
)