summaryrefslogtreecommitdiffstats
path: root/PRESUBMIT_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'PRESUBMIT_test.py')
-rwxr-xr-xPRESUBMIT_test.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/PRESUBMIT_test.py b/PRESUBMIT_test.py
index 979ad89..6a29aca 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()