Add more tests for file name formatter
This commit is contained in:
parent
1bf1db707c
commit
c2d3cfd50f
1 changed files with 16 additions and 0 deletions
|
@ -92,6 +92,22 @@ def test_format_full(
|
||||||
assert str(result) == expected
|
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.online
|
||||||
@pytest.mark.reddit
|
@pytest.mark.reddit
|
||||||
@pytest.mark.parametrize(('format_string_directory', 'format_string_file', 'index', 'expected'),
|
@pytest.mark.parametrize(('format_string_directory', 'format_string_file', 'index', 'expected'),
|
||||||
|
|
Loading…
Reference in a new issue