OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Unit tests for presubmit_support.py and presubmit_canned_checks.py.""" | 6 """Unit tests for presubmit_support.py and presubmit_canned_checks.py.""" |
7 | 7 |
8 import StringIO | 8 import StringIO |
9 | 9 |
10 # Fixes include path. | 10 # Fixes include path. |
(...skipping 1119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1130 'CheckChangeHasQaField', 'CheckChangeHasTestedField', | 1130 'CheckChangeHasQaField', 'CheckChangeHasTestedField', |
1131 'CheckChangeHasTestField', | 1131 'CheckChangeHasTestField', |
1132 'CheckChangeLintsClean', | 1132 'CheckChangeLintsClean', |
1133 'CheckChangeSvnEolStyle', | 1133 'CheckChangeSvnEolStyle', |
1134 'CheckLicense', | 1134 'CheckLicense', |
1135 'CheckSvnModifiedDirectories', | 1135 'CheckSvnModifiedDirectories', |
1136 'CheckSvnForCommonMimeTypes', 'CheckSvnProperty', | 1136 'CheckSvnForCommonMimeTypes', 'CheckSvnProperty', |
1137 'CheckDoNotSubmit', | 1137 'CheckDoNotSubmit', |
1138 'CheckDoNotSubmitInDescription', 'CheckDoNotSubmitInFiles', | 1138 'CheckDoNotSubmitInDescription', 'CheckDoNotSubmitInFiles', |
1139 'CheckLongLines', 'CheckTreeIsOpen', 'RunPythonUnitTests', | 1139 'CheckLongLines', 'CheckTreeIsOpen', 'RunPythonUnitTests', |
| 1140 'RunPylint', |
1140 'CheckBuildbotPendingBuilds', 'CheckRietveldTryJobExecution', | 1141 'CheckBuildbotPendingBuilds', 'CheckRietveldTryJobExecution', |
1141 ] | 1142 ] |
1142 # If this test fails, you should add the relevant test. | 1143 # If this test fails, you should add the relevant test. |
1143 self.compareMembers(presubmit_canned_checks, members) | 1144 self.compareMembers(presubmit_canned_checks, members) |
1144 | 1145 |
1145 def DescriptionTest(self, check, description1, description2, error_type, | 1146 def DescriptionTest(self, check, description1, description2, error_type, |
1146 committing): | 1147 committing): |
1147 change1 = presubmit.Change('foo1', description1, self.fake_root_dir, None, | 1148 change1 = presubmit.Change('foo1', description1, self.fake_root_dir, None, |
1148 0, 0) | 1149 0, 0) |
1149 input_api1 = self.MockInputApi(change1, committing) | 1150 input_api1 = self.MockInputApi(change1, committing) |
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1747 results = presubmit_canned_checks.CheckBuildbotPendingBuilds( | 1748 results = presubmit_canned_checks.CheckBuildbotPendingBuilds( |
1748 input_api, presubmit.OutputApi, 'uurl', 2, ('foo')) | 1749 input_api, presubmit.OutputApi, 'uurl', 2, ('foo')) |
1749 self.assertEquals(len(results), 1) | 1750 self.assertEquals(len(results), 1) |
1750 self.assertEquals(results[0].__class__, | 1751 self.assertEquals(results[0].__class__, |
1751 presubmit.OutputApi.PresubmitNotifyResult) | 1752 presubmit.OutputApi.PresubmitNotifyResult) |
1752 | 1753 |
1753 | 1754 |
1754 if __name__ == '__main__': | 1755 if __name__ == '__main__': |
1755 import unittest | 1756 import unittest |
1756 unittest.main() | 1757 unittest.main() |
OLD | NEW |