| Index: tests/presubmit_unittest.py
|
| diff --git a/tests/presubmit_unittest.py b/tests/presubmit_unittest.py
|
| index e61ca6cfa5ae437b0f6d0f5640da1a3f3d2af6f4..5d0812e46979e5a79a86ca6f483e43a80833eb07 100755
|
| --- a/tests/presubmit_unittest.py
|
| +++ b/tests/presubmit_unittest.py
|
| @@ -1181,7 +1181,7 @@ class GclChangeUnittest(PresubmitTestsBase):
|
| 'AbsoluteLocalPaths', 'AffectedFiles', 'AffectedTextFiles',
|
| 'DescriptionText', 'FullDescriptionText', 'LocalPaths', 'Name',
|
| 'RepositoryRoot', 'RightHandSideLines', 'ServerPaths',
|
| - 'approvers', 'issue', 'patchset', 'scm', 'tags',
|
| + 'issue', 'patchset', 'scm', 'tags',
|
| ]
|
| # If this test fails, you should add the relevant test.
|
| self.mox.ReplayAll()
|
| @@ -1863,9 +1863,20 @@ mac|success|blew
|
| fake_db = self.mox.CreateMock(owners.Database)
|
| input_api.owners_db = fake_db
|
| input_api.is_committing = is_committing
|
| + codereview_server = None
|
| + owners_email_regexp = owners.BASIC_EMAIL_REGEXP
|
|
|
| if is_committing:
|
| - change.approvers = approvers
|
| + change.issue = '1'
|
| + codereview_server = 'http://localhost'
|
| + messages = list('{"sender": "' + a + '","text": "lgtm"}' for
|
| + a in approvers)
|
| + rietveld_response = ('{"owner": "john@example.com",'
|
| + '"messages": [' + ','.join(messages) + ']}')
|
| + input_api.urllib2.urlopen(
|
| + 'http://localhost/api/1?messages=true').AndReturn(
|
| + StringIO.StringIO(rietveld_response))
|
| + input_api.json = presubmit.json
|
| fake_db.files_not_covered_by(set(['foo.cc']), approvers).AndReturn(
|
| uncovered_files)
|
| else:
|
| @@ -1875,7 +1886,7 @@ mac|success|blew
|
|
|
| self.mox.ReplayAll()
|
| results = presubmit_canned_checks.CheckOwners(input_api,
|
| - presubmit.OutputApi, None)
|
| + presubmit.OutputApi, codereview_server, owners_email_regexp, None)
|
| self.assertEquals(len(results), len(expected_results))
|
| if results and expected_results:
|
| output = StringIO.StringIO()
|
| @@ -1896,11 +1907,11 @@ mac|success|blew
|
| self.OwnersTest(is_committing=True,
|
| approvers=set(),
|
| uncovered_files=set(['foo.cc']),
|
| - expected_results=['Missing owner LGTM for: foo.cc\n'])
|
| + expected_results=['Missing LGTM from an OWNER for: foo.cc\n'])
|
|
|
| def testCannedCheckOwners_CommittingWithLGTMs(self):
|
| self.OwnersTest(is_committing=True,
|
| - approvers=set('ben@example.com'),
|
| + approvers=set(['ben@example.com']),
|
| uncovered_files=set(),
|
| expected_results=[])
|
|
|
|
|