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

Unified Diff: tests/owners_unittest.py

Issue 10384099: Readd missing unittests for owners (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Fix parent dir search 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « owners.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 4f9db7f240405d108fbc8731018e875f01fe1085..0e32ae0441966ca7b33ce17edfa9c46b5c55f541 100755
--- a/tests/owners_unittest.py
+++ b/tests/owners_unittest.py
@@ -49,6 +49,7 @@ def test_repo():
'/content/baz/froboz.h': '',
'/content/views/OWNERS': owners_file(ben, john, owners.EVERYONE,
noparent=True),
+ '/content/views/pie.h': '',
})
@@ -157,6 +158,30 @@ class OwnersDatabaseTest(unittest.TestCase):
def test_reviewers_for__wildcard_dir(self):
self.assert_reviewers_for(['DEPS'], [owners.EVERYONE])
+ 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])
+
+ 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'
+ ], [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])
+
def assert_syntax_error(self, owners_file_contents):
db = self.db()
self.files['/foo/OWNERS'] = owners_file_contents
« no previous file with comments | « owners.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698