OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 # pylint: disable=E1101,E1103 | 8 # pylint: disable=E1101,E1103 |
9 | 9 |
10 import functools | 10 import functools |
(...skipping 1867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1878 'CheckLicense', | 1878 'CheckLicense', |
1879 'CheckOwners', | 1879 'CheckOwners', |
1880 'CheckPatchFormatted', | 1880 'CheckPatchFormatted', |
1881 'CheckRietveldTryJobExecution', | 1881 'CheckRietveldTryJobExecution', |
1882 'CheckSingletonInHeaders', | 1882 'CheckSingletonInHeaders', |
1883 'CheckSvnModifiedDirectories', | 1883 'CheckSvnModifiedDirectories', |
1884 'CheckSvnForCommonMimeTypes', 'CheckSvnProperty', | 1884 'CheckSvnForCommonMimeTypes', 'CheckSvnProperty', |
1885 'RunPythonUnitTests', 'RunPylint', | 1885 'RunPythonUnitTests', 'RunPylint', |
1886 'RunUnitTests', 'RunUnitTestsInDirectory', | 1886 'RunUnitTests', 'RunUnitTestsInDirectory', |
1887 'GetPythonUnitTests', 'GetPylint', | 1887 'GetPythonUnitTests', 'GetPylint', |
1888 'GetUnitTests', 'GetUnitTestsInDirectory', | 1888 'GetUnitTests', 'GetUnitTestsInDirectory', 'GetGitUnitTestsRecursively', |
1889 ] | 1889 ] |
1890 # If this test fails, you should add the relevant test. | 1890 # If this test fails, you should add the relevant test. |
1891 self.compareMembers(presubmit_canned_checks, members) | 1891 self.compareMembers(presubmit_canned_checks, members) |
1892 | 1892 |
1893 def DescriptionTest(self, check, description1, description2, error_type, | 1893 def DescriptionTest(self, check, description1, description2, error_type, |
1894 committing): | 1894 committing): |
1895 change1 = presubmit.Change( | 1895 change1 = presubmit.Change( |
1896 'foo1', description1, self.fake_root_dir, None, 0, 0, None) | 1896 'foo1', description1, self.fake_root_dir, None, 0, 0, None) |
1897 input_api1 = self.MockInputApi(change1, committing) | 1897 input_api1 = self.MockInputApi(change1, committing) |
1898 change2 = presubmit.Change( | 1898 change2 = presubmit.Change( |
(...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2909 owners_check=False) | 2909 owners_check=False) |
2910 self.assertEqual(1, len(results)) | 2910 self.assertEqual(1, len(results)) |
2911 self.assertEqual( | 2911 self.assertEqual( |
2912 'Found line ending with white spaces in:', results[0]._message) | 2912 'Found line ending with white spaces in:', results[0]._message) |
2913 self.checkstdout('') | 2913 self.checkstdout('') |
2914 | 2914 |
2915 | 2915 |
2916 if __name__ == '__main__': | 2916 if __name__ == '__main__': |
2917 import unittest | 2917 import unittest |
2918 unittest.main() | 2918 unittest.main() |
OLD | NEW |