From f307fa6196f2e5fd962a5cb48716b5a388a2b14f Mon Sep 17 00:00:00 2001 From: Jesse Bannon Date: Sat, 17 Jun 2023 12:48:46 -0700 Subject: [PATCH] more tests --- tests/e2e/plugins/test_music_tags.py | 2 -- tests/e2e/plugins/test_regex.py | 4 +++- tests/e2e/plugins/test_split_by_chapters.py | 5 ++++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/e2e/plugins/test_music_tags.py b/tests/e2e/plugins/test_music_tags.py index c6cecf21..5538357b 100644 --- a/tests/e2e/plugins/test_music_tags.py +++ b/tests/e2e/plugins/test_music_tags.py @@ -1,8 +1,6 @@ import re import pytest -from expected_download import assert_expected_downloads -from expected_transaction_log import assert_transaction_log_matches from ytdl_sub.subscriptions.subscription import Subscription from ytdl_sub.utils.exceptions import ValidationException diff --git a/tests/e2e/plugins/test_regex.py b/tests/e2e/plugins/test_regex.py index 39a96078..32e899eb 100644 --- a/tests/e2e/plugins/test_regex.py +++ b/tests/e2e/plugins/test_regex.py @@ -349,7 +349,9 @@ class TestRegex: ) with pytest.raises( ValidationException, - match=re.escape("cannot regex capture 'dne' because it is not a source variable"), + match=re.escape( + "cannot regex capture 'dne' because it is not a source or override variable" + ), ): _ = Subscription.from_dict( config=music_video_config, diff --git a/tests/e2e/plugins/test_split_by_chapters.py b/tests/e2e/plugins/test_split_by_chapters.py index 4151ab71..f3e02e79 100644 --- a/tests/e2e/plugins/test_split_by_chapters.py +++ b/tests/e2e/plugins/test_split_by_chapters.py @@ -32,7 +32,9 @@ def yt_album_as_chapters_with_regex_preset_dict(yt_album_as_chapters_preset_dict { "regex": { "from": { - "chapter_title": { + # Ensure regex can handle override variables that come from the + # post-metadata stage + "override_chapter_title": { "match": r"\d+\. (.+)", "capture_group_names": "captured_track_title", "capture_group_defaults": "{chapter_title}", @@ -54,6 +56,7 @@ def yt_album_as_chapters_with_regex_preset_dict(yt_album_as_chapters_preset_dict } }, "overrides": { + "override_chapter_title": "{chapter_title}", "track_title": "{captured_track_title}", "track_album": "{captured_track_album}", "track_artist": "{captured_track_artist}",