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

Side by Side Diff: tests/owners_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 | « presubmit_canned_checks.py ('k') | tests/presubmit_unittest.py » ('j') | 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 owners.py.""" 6 """Unit tests for owners.py."""
7 7
8 import os 8 import os
9 import sys 9 import sys
10 import unittest 10 import unittest
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 ], 129 ],
130 [ken], 130 [ken],
131 ['content', 'content/baz']) 131 ['content', 'content/baz'])
132 132
133 def assert_reviewers_for(self, files, expected_reviewers): 133 def assert_reviewers_for(self, files, expected_reviewers):
134 db = self.db() 134 db = self.db()
135 self.assertEquals(db.reviewers_for(set(files)), set(expected_reviewers)) 135 self.assertEquals(db.reviewers_for(set(files)), set(expected_reviewers))
136 136
137 def test_reviewers_for__basic_functionality(self): 137 def test_reviewers_for__basic_functionality(self):
138 self.assert_reviewers_for(['chrome/gpu/gpu_channel.h'], 138 self.assert_reviewers_for(['chrome/gpu/gpu_channel.h'],
139 [ken, ben, brett, owners.EVERYONE]) 139 [brett])
140 140
141 def test_reviewers_for__set_noparent_works(self): 141 def test_reviewers_for__set_noparent_works(self):
142 self.assert_reviewers_for(['content/content.gyp'], [john, darin]) 142 self.assert_reviewers_for(['content/content.gyp'], [darin])
143 143
144 def test_reviewers_for__valid_inputs(self): 144 def test_reviewers_for__valid_inputs(self):
145 db = self.db() 145 db = self.db()
146 146
147 # Check that we're passed in a sequence that isn't a string. 147 # Check that we're passed in a sequence that isn't a string.
148 self.assertRaises(AssertionError, db.reviewers_for, 'foo') 148 self.assertRaises(AssertionError, db.reviewers_for, 'foo')
149 if hasattr(owners.collections, 'Iterable'): 149 if hasattr(owners.collections, 'Iterable'):
150 self.assertRaises(AssertionError, db.reviewers_for, 150 self.assertRaises(AssertionError, db.reviewers_for,
151 (f for f in ['x', 'y'])) 151 (f for f in ['x', 'y']))
152 152
(...skipping 19 matching lines...) Expand all
172 172
173 def test_syntax_error__unknown_set(self): 173 def test_syntax_error__unknown_set(self):
174 self.assert_syntax_error('set myfatherisbillgates\n') 174 self.assert_syntax_error('set myfatherisbillgates\n')
175 175
176 def test_syntax_error__bad_email(self): 176 def test_syntax_error__bad_email(self):
177 self.assert_syntax_error('ben\n') 177 self.assert_syntax_error('ben\n')
178 178
179 179
180 if __name__ == '__main__': 180 if __name__ == '__main__':
181 unittest.main() 181 unittest.main()
OLDNEW
« no previous file with comments | « presubmit_canned_checks.py ('k') | tests/presubmit_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698