| 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 2217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2228 def testCannedCheckLongLinesHttp(self): | 2228 def testCannedCheckLongLinesHttp(self): |
| 2229 check = lambda x, y, z: presubmit_canned_checks.CheckLongLines(x, y, 10, z) | 2229 check = lambda x, y, z: presubmit_canned_checks.CheckLongLines(x, y, 10, z) |
| 2230 self.ContentTest( | 2230 self.ContentTest( |
| 2231 check, | 2231 check, |
| 2232 ' http:// 0 23 5', | 2232 ' http:// 0 23 5', |
| 2233 None, | 2233 None, |
| 2234 ' http:// 0 23 56', | 2234 ' http:// 0 23 56', |
| 2235 None, | 2235 None, |
| 2236 presubmit.OutputApi.PresubmitPromptWarning) | 2236 presubmit.OutputApi.PresubmitPromptWarning) |
| 2237 | 2237 |
| 2238 def testCannedCheckLongLinesFile(self): |
| 2239 check = lambda x, y, z: presubmit_canned_checks.CheckLongLines(x, y, 10, z) |
| 2240 self.ContentTest( |
| 2241 check, |
| 2242 ' file:// 0 23 5', |
| 2243 None, |
| 2244 ' file:// 0 23 56', |
| 2245 None, |
| 2246 presubmit.OutputApi.PresubmitPromptWarning) |
| 2247 |
| 2248 |
| 2238 def testCannedCheckLongLinesLongSymbol(self): | 2249 def testCannedCheckLongLinesLongSymbol(self): |
| 2239 check = lambda x, y, z: presubmit_canned_checks.CheckLongLines(x, y, 10, z) | 2250 check = lambda x, y, z: presubmit_canned_checks.CheckLongLines(x, y, 10, z) |
| 2240 self.ContentTest( | 2251 self.ContentTest( |
| 2241 check, | 2252 check, |
| 2242 ' TUP5D_LoNG_SY ', | 2253 ' TUP5D_LoNG_SY ', |
| 2243 None, | 2254 None, |
| 2244 ' TUP5D_LoNG_SY5 ', | 2255 ' TUP5D_LoNG_SY5 ', |
| 2245 None, | 2256 None, |
| 2246 presubmit.OutputApi.PresubmitPromptWarning) | 2257 presubmit.OutputApi.PresubmitPromptWarning) |
| 2247 | 2258 |
| (...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2890 owners_check=False) | 2901 owners_check=False) |
| 2891 self.assertEqual(1, len(results)) | 2902 self.assertEqual(1, len(results)) |
| 2892 self.assertEqual( | 2903 self.assertEqual( |
| 2893 'Found line ending with white spaces in:', results[0]._message) | 2904 'Found line ending with white spaces in:', results[0]._message) |
| 2894 self.checkstdout('') | 2905 self.checkstdout('') |
| 2895 | 2906 |
| 2896 | 2907 |
| 2897 if __name__ == '__main__': | 2908 if __name__ == '__main__': |
| 2898 import unittest | 2909 import unittest |
| 2899 unittest.main() | 2910 unittest.main() |
| OLD | NEW |