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

Unified Diff: tests/owners_unittest.py

Issue 6639010: Add more tests for owners.py, remove unneeded code, make syntax errors more helpful (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 9 years, 9 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 fcae3ce9345024e63396e7c0557d93b2ce6da9b0..ea571636b09dc441c940a8e885c45340a2c1c3d1 100755
--- a/tests/owners_unittest.py
+++ b/tests/owners_unittest.py
@@ -72,6 +72,8 @@ class OwnersDatabaseTest(unittest.TestCase):
def test_covered_by__owners_propagates_down(self):
self.assert_covered_by(['chrome/gpu/OWNERS'], [ben])
+
+ def test_covered_by__no_file_in_dir(self):
self.assert_covered_by(['/chrome/renderer/gpu/gpu_channel_host.h'], [peter])
def assert_not_covered_by(self, files, reviewers, unreviewed_files):
@@ -114,8 +116,11 @@ class OwnersDatabaseTest(unittest.TestCase):
db = self.db()
self.files['/foo/OWNERS'] = owners_file_contents
self.files['/foo/DEPS'] = ''
- self.assertRaises(owners.SyntaxErrorInOwnersFile, db.reviewers_for,
- ['/foo/DEPS'])
+ try:
+ db.reviewers_for(['/foo/DEPS'])
+ self.fail() # pragma: no cover
+ except owners.SyntaxErrorInOwnersFile, e:
+ self.assertTrue(str(e).startswith('/foo/OWNERS:1'))
def test_syntax_error__unknown_token(self):
self.assert_syntax_error('{}\n')
« 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