From d8b181780c349c0cd94e6932a44d3b8ca82f7a54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dawid=20P=C5=82ocki?= Date: Sun, 19 May 2024 17:41:31 +0200 Subject: [PATCH] Add raising exception while marker file path is missing --- e2e/test_simple_configuration.py | 3 +-- podcast_downloader/__main__.py | 8 +++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/e2e/test_simple_configuration.py b/e2e/test_simple_configuration.py index 60038a9..78e71fb 100644 --- a/e2e/test_simple_configuration.py +++ b/e2e/test_simple_configuration.py @@ -386,5 +386,4 @@ def test_download_since_last_run_with_missing_marker_file_setup( podcast_downloader.run() # Assert - assert marker_file_manager.is_exists() - assert podcast_downloader.is_containing("Marker file") \ No newline at end of file + assert podcast_downloader.is_containing("Marker file") diff --git a/podcast_downloader/__main__.py b/podcast_downloader/__main__.py index ed70909..e8594ff 100644 --- a/podcast_downloader/__main__.py +++ b/podcast_downloader/__main__.py @@ -104,7 +104,13 @@ def configuration_to_function_on_empty_directory( return lambda source: source if configuration_value == "download_since_last_run": - return only_entities_from_date(last_run_date) + if last_run_date: + return only_entities_from_date(last_run_date) + + logger.error( + 'The "download_since_last_run" require setup the "last_run_mark_file_path"' + ) + raise Exception("Missing the last run mark file") local_time = time.localtime()