Skip to content

Commit

Permalink
Add e2e for option
Browse files Browse the repository at this point in the history
  • Loading branch information
dplocki committed Jan 24, 2024
1 parent 0e64edd commit 3d1f1b9
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 3 deletions.
7 changes: 4 additions & 3 deletions e2e/fixures.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,10 @@ def is_containing_only(self, expected_files_list: List[str]) -> None:
)
expected_unique_files = set(expected_files_list)

assert len(expected_unique_files) == len(
files_in_destination_directory
), f"The expected_files_list contain duplication"
if len(expected_unique_files) > 0:
assert len(expected_unique_files) == len(
files_in_destination_directory
), f"The expected_files_list contain duplication"
assert (
len(files_in_destination_directory & expected_unique_files) == 0
), f"The files in the podcast directory is different than expected"
Expand Down
40 changes: 40 additions & 0 deletions e2e/test_config_options.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
from typing import Callable, Dict
from e2e.fixures import (
FeedBuilder,
PodcastDirectory,
run_podcast_downloader,
# fixures:
feed,
use_config,
podcast_directory,
download_destination_directory,
)
from e2e.random import generate_random_string


def test_configuration_ignore_option(
feed: FeedBuilder,
use_config: Callable[[Dict], None],
podcast_directory: PodcastDirectory,
):
# Arrange
feed.add_random_entries()

use_config(
{
"podcasts": [
{
"disable": True,
"name": generate_random_string(),
"path": podcast_directory.path(),
"rss_link": feed.get_feed_url(),
}
]
}
)

# Act
run_podcast_downloader()

# Assert
podcast_directory.is_containing_only([])

0 comments on commit 3d1f1b9

Please sign in to comment.