fix tests and backwards source/playlist
This commit is contained in:
parent
600adcf0a8
commit
9778afdc4c
3 changed files with 14 additions and 10 deletions
|
|
@ -69,7 +69,7 @@ class EntryParent(BaseEntry):
|
||||||
|
|
||||||
def _parent_variables(self, parent_type: str) -> Dict:
|
def _parent_variables(self, parent_type: str) -> Dict:
|
||||||
def _(source_key: str, playlist_key: str) -> str:
|
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 {
|
return {
|
||||||
_(SOURCE_ENTRY, PLAYLIST_ENTRY): self._kwargs,
|
_(SOURCE_ENTRY, PLAYLIST_ENTRY): self._kwargs,
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,7 @@ def mock_entry_to_dict(
|
||||||
"title": "entry {title}",
|
"title": "entry {title}",
|
||||||
"title_sanitized": "entry {title}",
|
"title_sanitized": "entry {title}",
|
||||||
"ext": ext,
|
"ext": ext,
|
||||||
|
"description": "",
|
||||||
"extractor": extractor,
|
"extractor": extractor,
|
||||||
"upload_date": upload_date,
|
"upload_date": upload_date,
|
||||||
"upload_date_standardized": "2021-01-12",
|
"upload_date_standardized": "2021-01-12",
|
||||||
|
|
@ -85,12 +86,22 @@ def mock_entry_to_dict(
|
||||||
"thumbnail_ext": thumbnail_ext,
|
"thumbnail_ext": thumbnail_ext,
|
||||||
"info_json_ext": "info.json",
|
"info_json_ext": "info.json",
|
||||||
"webpage_url": webpage_url,
|
"webpage_url": webpage_url,
|
||||||
"playlist": "entry {title}",
|
|
||||||
"playlist_sanitized": "entry {title}",
|
|
||||||
"playlist_index": 1,
|
"playlist_index": 1,
|
||||||
"playlist_index_padded": "01",
|
"playlist_index_padded": "01",
|
||||||
"playlist_count": 1,
|
"playlist_count": 1,
|
||||||
"playlist_max_upload_year": 2021,
|
"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",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,11 +4,6 @@ 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
|
||||||
|
|
@ -49,7 +44,6 @@ 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,
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -66,7 +60,6 @@ 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