Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Side by Side Diff: tests/presubmit_unittest.py

Issue 10222020: Output a list of suggested OWNERS reviewers when needed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Ready for commit Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/owners_unittest.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Unit tests for presubmit_support.py and presubmit_canned_checks.py.""" 6 """Unit tests for presubmit_support.py and presubmit_canned_checks.py."""
7 7
8 # pylint: disable=E1101,E1103 8 # pylint: disable=E1101,E1103
9 9
10 import logging 10 import logging
(...skipping 2211 matching lines...) Expand 10 before | Expand all | Expand 10 after
2222 else: 2222 else:
2223 people = reviewers 2223 people = reviewers
2224 2224
2225 if issue: 2225 if issue:
2226 input_api.rietveld.get_issue_properties( 2226 input_api.rietveld.get_issue_properties(
2227 int(input_api.change.issue), True).AndReturn(rietveld_response) 2227 int(input_api.change.issue), True).AndReturn(rietveld_response)
2228 people.add(owner_email) 2228 people.add(owner_email)
2229 2229
2230 fake_db.directories_not_covered_by(set(['foo/xyz.cc']), 2230 fake_db.directories_not_covered_by(set(['foo/xyz.cc']),
2231 people).AndReturn(uncovered_dirs) 2231 people).AndReturn(uncovered_dirs)
2232 if not is_committing and uncovered_dirs:
2233 fake_db.reviewers_for(set(['foo/xyz.cc'])).AndReturn(owner_email)
2232 2234
2233 self.mox.ReplayAll() 2235 self.mox.ReplayAll()
2234 output = presubmit.PresubmitOutput() 2236 output = presubmit.PresubmitOutput()
2235 results = presubmit_canned_checks.CheckOwners(input_api, 2237 results = presubmit_canned_checks.CheckOwners(input_api,
2236 presubmit.OutputApi) 2238 presubmit.OutputApi)
2237 if results: 2239 if results:
2238 results[0].handle(output) 2240 results[0].handle(output)
2239 self.assertEquals(output.getvalue(), expected_output) 2241 self.assertEquals(output.getvalue(), expected_output)
2240 2242
2241 def testCannedCheckOwners_Approved(self): 2243 def testCannedCheckOwners_Approved(self):
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
2453 owners_check=False) 2455 owners_check=False)
2454 self.assertEqual(1, len(results)) 2456 self.assertEqual(1, len(results))
2455 self.assertEqual( 2457 self.assertEqual(
2456 'Found line ending with white spaces in:', results[0]._message) 2458 'Found line ending with white spaces in:', results[0]._message)
2457 self.checkstdout('') 2459 self.checkstdout('')
2458 2460
2459 2461
2460 if __name__ == '__main__': 2462 if __name__ == '__main__':
2461 import unittest 2463 import unittest
2462 unittest.main() 2464 unittest.main()
OLDNEW
« no previous file with comments | « tests/owners_unittest.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698