Skip to content

Commit

Permalink
E2E: Add test_ignore_files_not_being_part_of_the_feed
Browse files Browse the repository at this point in the history
  • Loading branch information
dplocki committed Feb 8, 2024
1 parent bfecc89 commit 4dbd433
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion e2e/test_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use_config,
podcast_directory,
)
from e2e.random import generate_random_string
from e2e.random import call_n_times, generate_random_mp3_file, generate_random_string


def test_configuration_hierarchy(
Expand Down Expand Up @@ -39,3 +39,33 @@ def test_configuration_hierarchy(

# Assert
assert len(podcast_directory.get_files_list()) == 1


def test_ignore_files_not_being_part_of_the_feed(
feed: FeedBuilder,
use_config: Callable[[Dict], None],
podcast_directory: PodcastDirectory,
):
# Arrange
feed.add_random_entries()
not_podcasts_files = call_n_times(generate_random_mp3_file)
last_podcast_file = generate_random_mp3_file()
feed.add_entry(file_name=last_podcast_file)

use_config(
{
"podcasts": [
{
"if_directory_empty": "download_last",
"path": podcast_directory.path(),
"rss_link": feed.get_feed_url(),
}
],
}
)

# Act
run_podcast_downloader()

# Assert
podcast_directory.is_containing_only(not_podcasts_files + [last_podcast_file])

0 comments on commit 4dbd433

Please sign in to comment.