当前位置: 首页>>代码示例>>Python>>正文


Python Review.load_comments方法代码示例

本文整理汇总了Python中lintreview.review.Review.load_comments方法的典型用法代码示例。如果您正苦于以下问题:Python Review.load_comments方法的具体用法?Python Review.load_comments怎么用?Python Review.load_comments使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在lintreview.review.Review的用法示例。


在下文中一共展示了Review.load_comments方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_filter_existing__removes_duplicates

# 需要导入模块: from lintreview.review import Review [as 别名]
# 或者: from lintreview.review.Review import load_comments [as 别名]
    def test_filter_existing__removes_duplicates(self, http):
        fixture_data = load_fixture('comments_current.json')
        response = Response()
        response._content = fixture_data
        http.return_value = response

        gh = Github()
        problems = Problems()
        review = Review(gh, 2)
        filename_1 = "Routing/Filter/AssetCompressor.php"
        filename_2 = "View/Helper/AssetCompressHelper.php"

        problems.add(filename_1, 87, 'A pithy remark')
        problems.add(filename_1, 87, 'Something different')
        problems.add(filename_2, 88, 'I <3 it')
        problems.add(filename_2, 89, 'Not such a good comment')

        review.load_comments()
        review.remove_existing(problems)

        res = problems.all(filename_1)
        eq_(1, len(res))
        expected = Comment(filename_1, 87, 87, 'Something different')
        eq_(res[0], expected)

        res = problems.all(filename_2)
        eq_(1, len(res))
        expected = Comment(filename_2, 88, 88, 'I <3 it')
        eq_(res[0], expected)
开发者ID:hutchic,项目名称:lint-review,代码行数:31,代码来源:test_review.py

示例2: test_filter_existing__removes_duplicates

# 需要导入模块: from lintreview.review import Review [as 别名]
# 或者: from lintreview.review.Review import load_comments [as 别名]
    def test_filter_existing__removes_duplicates(self):
        fixture_data = load_fixture('comments_current.json')
        self.pr.review_comments.return_value = map(
            lambda f: GhIssueComment(f),
            json.loads(fixture_data))
        problems = Problems()
        review = Review(self.gh, 2)
        filename_1 = "Routing/Filter/AssetCompressor.php"
        filename_2 = "View/Helper/AssetCompressHelper.php"

        problems.add(filename_1, 87, 'A pithy remark')
        problems.add(filename_1, 87, 'Something different')
        problems.add(filename_2, 88, 'I <3 it')
        problems.add(filename_2, 89, 'Not such a good comment')

        review.load_comments()
        review.remove_existing(problems)

        res = problems.all(filename_1)
        eq_(1, len(res))
        expected = Comment(filename_1, 87, 87, 'Something different')
        eq_(res[0], expected)

        res = problems.all(filename_2)
        eq_(1, len(res))
        expected = Comment(filename_2, 88, 88, 'I <3 it')
        eq_(res[0], expected)
开发者ID:pSub,项目名称:lint-review,代码行数:29,代码来源:test_review.py

示例3: test_filter_existing__removes_duplicates

# 需要导入模块: from lintreview.review import Review [as 别名]
# 或者: from lintreview.review.Review import load_comments [as 别名]
    def test_filter_existing__removes_duplicates(self):
        fixture_data = load_fixture('comments_current.json')
        self.pr.review_comments.return_value = [
            GhIssueComment(f, self.session) for f in json.loads(fixture_data)
        ]
        problems = Problems()
        review = Review(self.repo, self.pr, self.config)
        filename_1 = "Routing/Filter/AssetCompressor.php"
        filename_2 = "View/Helper/AssetCompressHelper.php"

        problems.add(filename_1, 87, 'A pithy remark')
        problems.add(filename_1, 87, 'Something different')
        problems.add(filename_2, 88, 'I <3 it')
        problems.add(filename_2, 89, 'Not such a good comment')

        review.load_comments()
        review.remove_existing(problems)

        res = problems.all(filename_1)
        self.assertEqual(1, len(res))
        expected = Comment(filename_1,
                           87,
                           87,
                           'A pithy remark\nSomething different')
        self.assertEqual(res[0], expected)

        res = problems.all(filename_2)
        self.assertEqual(1, len(res))
        expected = Comment(filename_2, 88, 88, 'I <3 it')
        self.assertEqual(res[0], expected)
开发者ID:markstory,项目名称:lint-review,代码行数:32,代码来源:test_review.py

示例4: test_load_comments__none_active

# 需要导入模块: from lintreview.review import Review [as 别名]
# 或者: from lintreview.review.Review import load_comments [as 别名]
    def test_load_comments__none_active(self):
        fixture_data = load_fixture('comments_none_current.json')
        self.pr.review_comments.return_value = [GhIssueComment(f) for f in json.loads(fixture_data)]

        review = Review(self.gh, 2)
        review.load_comments()

        eq_(0, len(review.comments("View/Helper/AssetCompressHelper.php")))
开发者ID:coras-io,项目名称:lint-review,代码行数:10,代码来源:test_review.py

示例5: test_load_comments__none_active

# 需要导入模块: from lintreview.review import Review [as 别名]
# 或者: from lintreview.review.Review import load_comments [as 别名]
    def test_load_comments__none_active(self):
        fixture_data = load_fixture('comments_none_current.json')
        self.pr.review_comments.return_value = map(
            lambda f: GhIssueComment(f),
            json.loads(fixture_data))

        review = Review(self.repo, self.pr)
        review.load_comments()

        eq_(0, len(review.comments("View/Helper/AssetCompressHelper.php")))
开发者ID:Ronan-,项目名称:lint-review,代码行数:12,代码来源:test_review.py

示例6: test_load_comments__none_active

# 需要导入模块: from lintreview.review import Review [as 别名]
# 或者: from lintreview.review.Review import load_comments [as 别名]
    def test_load_comments__none_active(self, http):
        fixture_data = load_fixture('comments_none_current.json')
        response = Response()
        response._content = fixture_data
        http.return_value = response

        gh = Github()
        review = Review(gh, 2)
        review.load_comments()

        eq_(0, len(review.comments("View/Helper/AssetCompressHelper.php")))
开发者ID:hutchic,项目名称:lint-review,代码行数:13,代码来源:test_review.py

示例7: test_load_comments__none_active

# 需要导入模块: from lintreview.review import Review [as 别名]
# 或者: from lintreview.review.Review import load_comments [as 别名]
    def test_load_comments__none_active(self):
        fixture_data = load_fixture('comments_none_current.json')
        self.pr.review_comments.return_value = [
            GhIssueComment(f, self.session) for f in json.loads(fixture_data)
        ]

        review = Review(self.repo, self.pr, self.config)
        review.load_comments()

        filename = "View/Helper/AssetCompressHelper.php"
        self.assertEqual(0, len(review.comments(filename)))
开发者ID:markstory,项目名称:lint-review,代码行数:13,代码来源:test_review.py

示例8: test_load_comments__loads_comments

# 需要导入模块: from lintreview.review import Review [as 别名]
# 或者: from lintreview.review.Review import load_comments [as 别名]
    def test_load_comments__loads_comments(self):
        fixture_data = load_fixture('comments_current.json')
        self.pr.review_comments.return_value = [GhIssueComment(f) for f in json.loads(fixture_data)]
        review = Review(self.gh, 2)
        review.load_comments()

        filename = "Routing/Filter/AssetCompressor.php"
        res = review.comments(filename)
        eq_(1, len(res))
        expected = Comment(filename, None, 87, "A pithy remark")
        eq_(expected, res[0])

        filename = "View/Helper/AssetCompressHelper.php"
        res = review.comments(filename)
        eq_(2, len(res))
        expected = Comment(filename, None, 40, "Some witty comment.")
        eq_(expected, res[0])

        expected = Comment(filename, None, 89, "Not such a good comment")
        eq_(expected, res[1])
开发者ID:coras-io,项目名称:lint-review,代码行数:22,代码来源:test_review.py

示例9: test_load_comments__loads_comments

# 需要导入模块: from lintreview.review import Review [as 别名]
# 或者: from lintreview.review.Review import load_comments [as 别名]
    def test_load_comments__loads_comments(self, http):
        fixture_data = load_fixture('comments_current.json')
        response = Response()
        response._content = fixture_data
        http.return_value = response

        gh = Github()
        review = Review(gh, 2)
        review.load_comments()

        filename = "Routing/Filter/AssetCompressor.php"
        res = review.comments(filename)
        eq_(1, len(res))
        expected = Comment(filename, None, 87, "A pithy remark")
        eq_(expected, res[0])

        filename = "View/Helper/AssetCompressHelper.php"
        res = review.comments(filename)
        eq_(2, len(res))
        expected = Comment(filename, None, 40, "Some witty comment.")
        eq_(expected, res[0])

        expected = Comment(filename, None, 89, "Not such a good comment")
        eq_(expected, res[1])
开发者ID:hutchic,项目名称:lint-review,代码行数:26,代码来源:test_review.py


注:本文中的lintreview.review.Review.load_comments方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。