本文整理匯總了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'])