Mark online tests
This commit is contained in:
@@ -13,6 +13,7 @@ def reddit_submission(reddit_instance) -> praw.models.Submission:
|
|||||||
return reddit_instance.submission(id='ljyy27')
|
return reddit_instance.submission(id='ljyy27')
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.online
|
||||||
def test_gallery(reddit_submission: praw.models.Submission):
|
def test_gallery(reddit_submission: praw.models.Submission):
|
||||||
gallery = Gallery(reddit_submission)
|
gallery = Gallery(reddit_submission)
|
||||||
results = gallery.find_resources()
|
results = gallery.find_resources()
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ def test_format_name_mock(format_string: str, expected: str, submission: Mock):
|
|||||||
assert result == expected
|
assert result == expected
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.online
|
||||||
@pytest.mark.parametrize(('format_string', 'expected'),
|
@pytest.mark.parametrize(('format_string', 'expected'),
|
||||||
(('{SUBREDDIT}', 'Mindustry'),
|
(('{SUBREDDIT}', 'Mindustry'),
|
||||||
('{REDDITOR}', 'Gamer_player_boi'),
|
('{REDDITOR}', 'Gamer_player_boi'),
|
||||||
@@ -55,6 +56,7 @@ def test_format_name_real(format_string: str, expected: str, reddit_submission:
|
|||||||
assert result == expected
|
assert result == expected
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.online
|
||||||
@pytest.mark.parametrize(('format_string_directory', 'format_string_file', 'expected'),
|
@pytest.mark.parametrize(('format_string_directory', 'format_string_file', 'expected'),
|
||||||
(('{SUBREDDIT}', '{POSTID}', 'test/Mindustry/lgilgt.png'),
|
(('{SUBREDDIT}', '{POSTID}', 'test/Mindustry/lgilgt.png'),
|
||||||
('{SUBREDDIT}', '{TITLE}_{POSTID}',
|
('{SUBREDDIT}', '{TITLE}_{POSTID}',
|
||||||
@@ -67,7 +69,7 @@ def test_format_full(
|
|||||||
format_string_file: str,
|
format_string_file: str,
|
||||||
expected: str,
|
expected: str,
|
||||||
reddit_submission: praw.models.Submission):
|
reddit_submission: praw.models.Submission):
|
||||||
test_resource = Resource(reddit_submission, 'i.reddit.com/blabla.png', b'')
|
test_resource = Resource(reddit_submission, 'i.reddit.com/blabla.png')
|
||||||
test_formatter = FileNameFormatter(format_string_file, format_string_directory)
|
test_formatter = FileNameFormatter(format_string_file, format_string_directory)
|
||||||
result = test_formatter.format_path(test_resource, Path('test'))
|
result = test_formatter.format_path(test_resource, Path('test'))
|
||||||
assert str(result) == expected
|
assert str(result) == expected
|
||||||
|
|||||||
3
pytest.ini
Normal file
3
pytest.ini
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
[pytest]
|
||||||
|
markers =
|
||||||
|
online: tests require a connection to the internet
|
||||||
Reference in New Issue
Block a user