1
0
Fork 0
mirror of synced 2024-06-25 17:40:17 +12:00

Add more tests for file name formatter

This commit is contained in:
Serene-Arc 2021-03-14 11:10:26 +10:00 committed by Ali Parlakci
parent 1bf1db707c
commit c2d3cfd50f

View file

@ -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'),