diff --git a/bulkredditdownloader/tests/test_file_name_formatter.py b/bulkredditdownloader/tests/test_file_name_formatter.py index 3b79904..b376e9d 100644 --- a/bulkredditdownloader/tests/test_file_name_formatter.py +++ b/bulkredditdownloader/tests/test_file_name_formatter.py @@ -92,6 +92,22 @@ def test_format_full( assert str(result) == expected +@pytest.mark.online +@pytest.mark.reddit +@pytest.mark.parametrize(('format_string_directory', 'format_string_file'), ( + ('{SUBREDDIT}', '{POSTID}'), + ('{SUBREDDIT}', '{UPVOTES}'), + ('{SUBREDDIT}', '{UPVOTES}{POSTID}'), +)) +def test_format_full_conform( + format_string_directory: str, + format_string_file: str, + reddit_submission: praw.models.Submission): + test_resource = Resource(reddit_submission, 'i.reddit.com/blabla.png') + test_formatter = FileNameFormatter(format_string_file, format_string_directory) + test_formatter.format_path(test_resource, Path('test')) + + @pytest.mark.online @pytest.mark.reddit @pytest.mark.parametrize(('format_string_directory', 'format_string_file', 'index', 'expected'),