Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async def test_subreddit_moderation_listing(self, reddit):
subreddit = await reddit.subreddit("aprawtest")
report = None
async for rep in subreddit.mod.reports():
report = rep
break
assert isinstance(
report, apraw.models.Submission) or isinstance(
report, apraw.models.Comment)
async def test_submission_morechildren(self, reddit):
submission = await reddit.submission("h7mna9")
children = []
async for comment in submission.comments():
children.append(comment.id)
async for comment in submission.morechildren(children):
assert isinstance(comment, apraw.models.Comment)
async def test_user_inbox(self, reddit):
user = await reddit.user.me()
async for item in user.inbox():
assert isinstance(item, apraw.models.Comment) or isinstance(item, apraw.models.Message)
def scan_comments(c):
for reply in c.replies:
assert isinstance(reply, apraw.models.Comment)
scan_comments(reply)
async def test_user_unread(self, reddit):
user = await reddit.user.me()
async for item in user.unread():
assert isinstance(item, apraw.models.Comment) or isinstance(item, apraw.models.Message)
id: str
The ID of a comment (with or without kind).
url: str
The URL of a comment.
Returns
-------
comment: Comment
The requested comment.
"""
if id != "":
comment = Comment(self, {"id": id})
await comment.fetch()
return comment
else:
comment = Comment(self, {"url": url})
await comment.fetch()
return comment