Skip to content

Commit

Permalink
E2E: add the test_configuration_file_name_template_option
Browse files Browse the repository at this point in the history
  • Loading branch information
dplocki committed Jan 27, 2024
1 parent 6407321 commit 97df20a
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions e2e/test_config_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,34 @@ def test_configuration_podcast_extensions_option(

# Assert
podcast_directory.is_containing_only([file_name.lower() for file_name in avi_files])


def test_configuration_file_name_template_option(
feed: FeedBuilder,
use_config: Callable[[Dict], None],
podcast_directory: PodcastDirectory,
):
mp3_files_date = [generate_random_mp3_file() for _ in range(generate_random_int())]

for file_name in mp3_files_date:
feed.add_entry(file_name=file_name)

use_config(
{
"if_directory_empty": "download_all_from_feed",
"podcasts": [
{
"file_name_template": "%file_name%_terminus_est_%file_extension%",
"name": generate_random_string(),
"path": podcast_directory.path(),
"rss_link": feed.get_feed_url(),
}
],
}
)

# Act
run_podcast_downloader()

# Assert
podcast_directory.is_containing_only([file_name.lower().replace('.', '_terminus_est_') for file_name in mp3_files_date])

0 comments on commit 97df20a

Please sign in to comment.