예제 #1
0
파일: test_comment.py 프로젝트: RGood/praw
 def test_edit(self, _):
     self.reddit.read_only = False
     with self.recorder.use_cassette(
             'TestComment.test_edit'):
         comment = Comment(self.reddit, 'd1616q2')
         comment.edit('New text')
         assert comment.body == 'New text'
예제 #2
0
def modify_exisiting_comment(
    comment: Comment, comment_string: str, post_tags: List[str]
) -> None:
    logger.debug(comment.body)
    if comment_string != comment.body:
        if len(post_tags) > 0:
            comment.edit(comment_string)
            logger.info(f"edited {comment_string}")
        else:
            comment.delete()
            logger.info(f"Comment deleted: {comment_string}")
    else:
        logger.info("Comment is the same as last time, not editing")
예제 #3
0
 def test_edit(self, _):
     self.reddit.read_only = False
     with self.recorder.use_cassette("TestComment.test_edit"):
         comment = Comment(self.reddit, "d1616q2")
         comment.edit("New text")
         assert comment.body == "New text"
예제 #4
0
 def test_edit(self, _):
     self.reddit.read_only = False
     with self.recorder.use_cassette("TestComment.test_edit"):
         comment = Comment(self.reddit, "d1616q2")
         comment.edit("New text")
         assert comment.body == "New text"