當前位置: 首頁>>代碼示例>>Python>>正文


Python Checkout.suggested_reviewers方法代碼示例

本文整理匯總了Python中webkitpy.common.checkout.api.Checkout.suggested_reviewers方法的典型用法代碼示例。如果您正苦於以下問題:Python Checkout.suggested_reviewers方法的具體用法?Python Checkout.suggested_reviewers怎麽用?Python Checkout.suggested_reviewers使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在webkitpy.common.checkout.api.Checkout的用法示例。


在下文中一共展示了Checkout.suggested_reviewers方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_suggested_reviewers

# 需要導入模塊: from webkitpy.common.checkout.api import Checkout [as 別名]
# 或者: from webkitpy.common.checkout.api.Checkout import suggested_reviewers [as 別名]
    def test_suggested_reviewers(self):
        def mock_changelog_entries_for_revision(revision):
            if revision % 2 == 0:
                return [ChangeLogEntry(_changelog1entry1)]
            return [ChangeLogEntry(_changelog1entry2)]

        def mock_revisions_changing_file(path, limit=5):
            if path.endswith("ChangeLog"):
                return [3]
            return [4, 8]

        scm = Mock()
        scm.checkout_root = "/foo/bar"
        scm.changed_files = lambda git_commit: ["file1", "file2", "relative/path/ChangeLog"]
        scm.revisions_changing_file = mock_revisions_changing_file
        checkout = Checkout(scm)
        checkout.changelog_entries_for_revision = mock_changelog_entries_for_revision
        reviewers = checkout.suggested_reviewers(git_commit=None)
        reviewer_names = [reviewer.full_name for reviewer in reviewers]
        self.assertEqual(reviewer_names, [u'Tor Arne Vestb\xf8'])
開發者ID:achellies,項目名稱:WinCEWebKit,代碼行數:22,代碼來源:api_unittest.py


注:本文中的webkitpy.common.checkout.api.Checkout.suggested_reviewers方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。