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

Unified Diff: tests/owners_unittest.py

Issue 11569018: Suggest owners for OWNERS files that only have per-file owners. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 8 years 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 side-by-side diff with in-line comments
Download patch
« testing_support/filesystem_mock.py ('K') | « testing_support/filesystem_mock.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/owners_unittest.py
diff --git a/tests/owners_unittest.py b/tests/owners_unittest.py
index e031ab87b92290a47f18123fd2bb3b8378b4e3f0..34272a1337da077c57ab3ff285f7e219b4ab572b 100755
--- a/tests/owners_unittest.py
+++ b/tests/owners_unittest.py
@@ -234,34 +234,39 @@ class OwnersDatabaseTest(unittest.TestCase):
def test_reviewers_for__one_owner(self):
self.assert_reviewers_for([
- '/chrome/gpu/gpu_channel.h',
- '/content/baz/froboz.h',
- '/chrome/renderer/gpu/gpu_channel_host.h'], [brett])
+ 'chrome/gpu/gpu_channel.h',
+ 'content/baz/froboz.h',
+ 'chrome/renderer/gpu/gpu_channel_host.h'], [brett])
def test_reviewers_for__two_owners(self):
self.assert_reviewers_for([
- '/chrome/gpu/gpu_channel.h',
- '/content/content.gyp',
- '/content/baz/froboz.h',
- '/content/views/pie.h'
+ 'chrome/gpu/gpu_channel.h',
+ 'content/content.gyp',
+ 'content/baz/froboz.h',
+ 'content/views/pie.h'
], [john, brett])
def test_reviewers_for__all_files(self):
self.assert_reviewers_for([
- '/chrome/gpu/gpu_channel.h',
- '/chrome/renderer/gpu/gpu_channel_host.h',
- '/chrome/renderer/safe_browsing/scorer.h',
- '/content/content.gyp',
- '/content/bar/foo.cc',
- '/content/baz/froboz.h',
- '/content/views/pie.h'], [john, brett])
+ 'chrome/gpu/gpu_channel.h',
+ 'chrome/renderer/gpu/gpu_channel_host.h',
+ 'chrome/renderer/safe_browsing/scorer.h',
+ 'content/content.gyp',
+ 'content/bar/foo.cc',
+ 'content/baz/froboz.h',
+ 'content/views/pie.h'], [john, brett])
+
+ def test_reviewers_for__per_file_owners_file(self):
+ self.files['/content/baz/OWNERS'] = owners_file(lines=[
+ 'per-file ugly.*=tom@example.com'])
+ self.assert_reviewers_for(['content/baz/OWNERS'], [darin])
def assert_syntax_error(self, owners_file_contents):
db = self.db()
self.files['/foo/OWNERS'] = owners_file_contents
self.files['/foo/DEPS'] = ''
try:
- db.reviewers_for(['/foo/DEPS'])
+ db.reviewers_for(['foo/DEPS'])
self.fail() # pragma: no cover
except owners.SyntaxErrorInOwnersFile, e:
self.assertTrue(str(e).startswith('/foo/OWNERS:1'))
« testing_support/filesystem_mock.py ('K') | « testing_support/filesystem_mock.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698