From f741649001d0c7076696e78d3e2903abe74c6ca1 Mon Sep 17 00:00:00 2001 From: Jesse Bannon Date: Wed, 14 Sep 2022 12:16:20 -0700 Subject: [PATCH] fix tests --- src/ytdl_sub/entries/entry_parent.py | 4 +--- src/ytdl_sub/ytdl_additions/enhanced_download_archive.py | 8 ++++---- tests/unit/entries/conftest.py | 6 ++++++ 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/ytdl_sub/entries/entry_parent.py b/src/ytdl_sub/entries/entry_parent.py index 966682f0..a9adebc9 100644 --- a/src/ytdl_sub/entries/entry_parent.py +++ b/src/ytdl_sub/entries/entry_parent.py @@ -10,9 +10,7 @@ TBaseEntry = TypeVar("TBaseEntry", bound=BaseEntry) class EntryParent(BaseEntry): - def __init__( - self, entry_dict: Dict, working_directory: str - ): + def __init__(self, entry_dict: Dict, working_directory: str): super().__init__(entry_dict=entry_dict, working_directory=working_directory) self.child_entries: List["EntryParent"] = [] diff --git a/src/ytdl_sub/ytdl_additions/enhanced_download_archive.py b/src/ytdl_sub/ytdl_additions/enhanced_download_archive.py index b39cacd7..24d0ef84 100644 --- a/src/ytdl_sub/ytdl_additions/enhanced_download_archive.py +++ b/src/ytdl_sub/ytdl_additions/enhanced_download_archive.py @@ -598,7 +598,7 @@ class DownloadArchiver: """ def __init__(self, enhanced_download_archive: EnhancedDownloadArchive): - self.__enhanced_download_archive = enhanced_download_archive + self._enhanced_download_archive = enhanced_download_archive @property def working_directory(self) -> str: @@ -607,7 +607,7 @@ class DownloadArchiver: ------- Path to the working directory """ - return self.__enhanced_download_archive.working_directory + return self._enhanced_download_archive.working_directory @property def is_dry_run(self) -> bool: @@ -616,7 +616,7 @@ class DownloadArchiver: ------- True if this session is a dry-run. False otherwise. """ - return self.__enhanced_download_archive.is_dry_run + return self._enhanced_download_archive.is_dry_run def save_file( self, @@ -640,7 +640,7 @@ class DownloadArchiver: entry Optional. Entry that the file belongs to """ - self.__enhanced_download_archive.save_file_to_output_directory( + self._enhanced_download_archive.save_file_to_output_directory( file_name=file_name, file_metadata=file_metadata, output_file_name=output_file_name, diff --git a/tests/unit/entries/conftest.py b/tests/unit/entries/conftest.py index 6a4a5a95..af6239c1 100644 --- a/tests/unit/entries/conftest.py +++ b/tests/unit/entries/conftest.py @@ -85,6 +85,12 @@ 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, }