Refactor and optimise some tests (#245)

* Rename to follow actual directory name

* Remove unnecessary Reddit call from test

* Refactor test to reduce duplication

* Parameterise some tests

* Standardise formatting
This commit is contained in:
Serene
2021-04-04 03:25:58 +10:00
committed by Ali Parlakci
parent a05fa1a965
commit 2385867afb
19 changed files with 189 additions and 133 deletions

View File

@@ -22,7 +22,11 @@ def test_get_comments(test_submission_id: str, min_comments: int, reddit_instanc
@pytest.mark.online
@pytest.mark.reddit
@pytest.mark.parametrize(('test_submission_id', 'expected_dict'), (
('m3reby', {'author': 'sinjen-tos', 'id': 'm3reby', 'link_flair_text': 'image'}),
('m3reby', {
'author': 'sinjen-tos',
'id': 'm3reby',
'link_flair_text': 'image',
}),
('m3kua3', {'author': 'DELETED'}),
))
def test_get_post_details(test_submission_id: str, expected_dict: dict, reddit_instance: praw.Reddit):