def test_replace__all_with_comment_sort(self): with self.use_cassette(match_requests_on=["uri", "method", "body"]): submission = Submission(self.reddit, "3hahrw") submission.comment_sort = "old" skipped = submission.comments.replace_more(None, threshold=0) assert len(skipped) == 0 assert len(submission.comments.list()) >= 500
def test_replace__all_with_comment_sort(self): with self.recorder.use_cassette( 'TestCommentForest.test_replace__all_with_comment_sort', match_requests_on=['uri', 'method', 'body']): submission = Submission(self.reddit, '3hahrw') submission.comment_sort = 'old' skipped = submission.comments.replace_more(None, threshold=0) assert len(skipped) == 0 assert len(submission.comments.list()) >= 500
def test_replace__all_with_comment_sort(self): with self.recorder.use_cassette( "TestCommentForest.test_replace__all_with_comment_sort", match_requests_on=["uri", "method", "body"], ): submission = Submission(self.reddit, "3hahrw") submission.comment_sort = "old" skipped = submission.comments.replace_more(None, threshold=0) assert len(skipped) == 0 assert len(submission.comments.list()) >= 500
def load_comments(id): submission = Submission(handler, id) submission.comment_sort = 'top' parent = submission.comments parent_node = Node("Comments") for child in parent: if isinstance(child, MoreComments): continue try: print_comments(child, parent_node) except AttributeError: continue # for pre, fill, node in RenderTree(parent_node): # print("%s%s" % (pre, node.name)) return parent_node