Merge pull request #409 from Ailothaen/master

Adding info to threads and comments: distinguished, spoiler, pinned, locked
This commit is contained in:
Ali Parlakçı
2021-05-21 00:04:53 +03:00
committed by GitHub
4 changed files with 13 additions and 0 deletions

View File

@@ -26,6 +26,7 @@ class BaseArchiveEntry(ABC):
'stickied': in_comment.stickied, 'stickied': in_comment.stickied,
'body': in_comment.body, 'body': in_comment.body,
'is_submitter': in_comment.is_submitter, 'is_submitter': in_comment.is_submitter,
'distinguished': in_comment.distinguished,
'created_utc': in_comment.created_utc, 'created_utc': in_comment.created_utc,
'parent_id': in_comment.parent_id, 'parent_id': in_comment.parent_id,
'replies': [], 'replies': [],

View File

@@ -35,6 +35,10 @@ class SubmissionArchiveEntry(BaseArchiveEntry):
'link_flair_text': self.source.link_flair_text, 'link_flair_text': self.source.link_flair_text,
'num_comments': self.source.num_comments, 'num_comments': self.source.num_comments,
'over_18': self.source.over_18, 'over_18': self.source.over_18,
'spoiler': self.source.spoiler,
'pinned': self.source.pinned,
'locked': self.source.locked,
'distinguished': self.source.distinguished,
'created_utc': self.source.created_utc, 'created_utc': self.source.created_utc,
} }

View File

@@ -15,6 +15,7 @@ from bdfr.archive_entry.comment_archive_entry import CommentArchiveEntry
'subreddit': 'Python', 'subreddit': 'Python',
'submission': 'mgi4op', 'submission': 'mgi4op',
'submission_title': '76% Faster CPython', 'submission_title': '76% Faster CPython',
'distinguished': None,
}), }),
)) ))
def test_get_comment_details(test_comment_id: str, expected_dict: dict, reddit_instance: praw.Reddit): def test_get_comment_details(test_comment_id: str, expected_dict: dict, reddit_instance: praw.Reddit):

View File

@@ -26,6 +26,13 @@ def test_get_comments(test_submission_id: str, min_comments: int, reddit_instanc
'author': 'sinjen-tos', 'author': 'sinjen-tos',
'id': 'm3reby', 'id': 'm3reby',
'link_flair_text': 'image', 'link_flair_text': 'image',
'pinned': False,
'spoiler': False,
'over_18': False,
'locked': False,
'distinguished': None,
'created_utc': 1615583837,
'permalink': '/r/australia/comments/m3reby/this_little_guy_fell_out_of_a_tree_and_in_front/'
}), }),
('m3kua3', {'author': 'DELETED'}), ('m3kua3', {'author': 'DELETED'}),
)) ))