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

Unified Diff: PRESUBMIT_test.py

Issue 11830057: Don't issue try jobs for OWNERS-only changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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
« PRESUBMIT.py ('K') | « PRESUBMIT.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: PRESUBMIT_test.py
diff --git a/PRESUBMIT_test.py b/PRESUBMIT_test.py
index 979ad892f1a58278ef1f248fd462ffc67b7824ee..6a29aca96ed4af7dbb7c506f920e8d6b0b000b7a 100755
--- a/PRESUBMIT_test.py
+++ b/PRESUBMIT_test.py
@@ -60,6 +60,14 @@ class MockFile(object):
return self._local_path
+class MockChange(object):
+ def __init__(self, changed_files):
+ self._changed_files = changed_files
+
+ def LocalPaths(self):
+ return self._changed_files
+
+
class IncludeOrderTest(unittest.TestCase):
def testSystemHeaderOrder(self):
scope = [(1, '#include <csystem.h>'),
@@ -339,6 +347,14 @@ class BadExtensionsTest(unittest.TestCase):
results = PRESUBMIT._CheckPatchFiles(mock_input_api, MockOutputApi())
self.assertEqual(0, len(results))
+ def testOnlyOwnersFiles(self):
+ mock_change = MockChange([
+ 'some/path/OWNERS',
+ 'A\Windows\Path\OWNERS',
+ ])
+ results = PRESUBMIT.GetPreferredTrySlaves(None, mock_change)
+ self.assertEqual(0, len(results))
+
if __name__ == '__main__':
unittest.main()
« PRESUBMIT.py ('K') | « PRESUBMIT.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698