| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2006-2009 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 # Local imports | 10 # Local imports |
| (...skipping 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1054 return input_api | 1054 return input_api |
| 1055 | 1055 |
| 1056 def testMembersChanged(self): | 1056 def testMembersChanged(self): |
| 1057 self.mox.ReplayAll() | 1057 self.mox.ReplayAll() |
| 1058 members = [ | 1058 members = [ |
| 1059 'CheckChangeHasBugField', 'CheckChangeHasDescription', | 1059 'CheckChangeHasBugField', 'CheckChangeHasDescription', |
| 1060 'CheckChangeHasNoStrayWhitespace', | 1060 'CheckChangeHasNoStrayWhitespace', |
| 1061 'CheckChangeHasOnlyOneEol', 'CheckChangeHasNoCR', | 1061 'CheckChangeHasOnlyOneEol', 'CheckChangeHasNoCR', |
| 1062 'CheckChangeHasNoCrAndHasOnlyOneEol', 'CheckChangeHasNoTabs', | 1062 'CheckChangeHasNoCrAndHasOnlyOneEol', 'CheckChangeHasNoTabs', |
| 1063 'CheckChangeHasQaField', 'CheckChangeHasTestedField', | 1063 'CheckChangeHasQaField', 'CheckChangeHasTestedField', |
| 1064 'CheckChangeHasTestField', 'CheckChangeSvnEolStyle', | 1064 'CheckChangeHasTestField', |
| 1065 'CheckChangeLintsClean', |
| 1066 'CheckChangeSvnEolStyle', |
| 1065 'CheckSvnModifiedDirectories', | 1067 'CheckSvnModifiedDirectories', |
| 1066 'CheckSvnForCommonMimeTypes', 'CheckSvnProperty', | 1068 'CheckSvnForCommonMimeTypes', 'CheckSvnProperty', |
| 1067 'CheckDoNotSubmit', | 1069 'CheckDoNotSubmit', |
| 1068 'CheckDoNotSubmitInDescription', 'CheckDoNotSubmitInFiles', | 1070 'CheckDoNotSubmitInDescription', 'CheckDoNotSubmitInFiles', |
| 1069 'CheckLongLines', 'CheckTreeIsOpen', 'RunPythonUnitTests', | 1071 'CheckLongLines', 'CheckTreeIsOpen', 'RunPythonUnitTests', |
| 1070 ] | 1072 ] |
| 1071 # If this test fails, you should add the relevant test. | 1073 # If this test fails, you should add the relevant test. |
| 1072 self.compareMembers(presubmit_canned_checks, members) | 1074 self.compareMembers(presubmit_canned_checks, members) |
| 1073 | 1075 |
| 1074 def DescriptionTest(self, check, description1, description2, error_type, | 1076 def DescriptionTest(self, check, description1, description2, error_type, |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1454 self.mox.ReplayAll() | 1456 self.mox.ReplayAll() |
| 1455 | 1457 |
| 1456 results = presubmit_canned_checks.RunPythonUnitTests( | 1458 results = presubmit_canned_checks.RunPythonUnitTests( |
| 1457 input_api, presubmit.OutputApi, ['test_module']) | 1459 input_api, presubmit.OutputApi, ['test_module']) |
| 1458 self.assertEquals(len(results), 0) | 1460 self.assertEquals(len(results), 0) |
| 1459 | 1461 |
| 1460 | 1462 |
| 1461 if __name__ == '__main__': | 1463 if __name__ == '__main__': |
| 1462 import unittest | 1464 import unittest |
| 1463 unittest.main() | 1465 unittest.main() |
| OLD | NEW |