示例#1
0
    def test_get_success(self, simple_comment):
        # arrange
        expected_comment = CommentDBRepo.decode_orm_comment(simple_comment)
        test_id = simple_comment.id

        # act
        result_comment = CommentDBRepo.get(comment_id=test_id)

        # assert
        assert result_comment.text == expected_comment.text
示例#2
0
    def test_get_all_success(self, comments_20):
        # arrange
        expected_comments = []
        for g in comments_20:
            expected_comments.append(CommentDBRepo.decode_orm_comment(g))

        # act
        result_comments = CommentDBRepo.get_all(expected_comments[0].film)

        # assert
        for i in range(10):
            assert result_comments[i].text == expected_comments[i].text