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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 | 164 |
165 def testMembersChanged(self): | 165 def testMembersChanged(self): |
166 self.mox.ReplayAll() | 166 self.mox.ReplayAll() |
167 members = [ | 167 members = [ |
168 'AffectedFile', 'Change', 'DoGetTrySlaves', | 168 'AffectedFile', 'Change', 'DoGetTrySlaves', |
169 'DoPostUploadExecuter', 'DoPresubmitChecks', 'GetPostUploadExecuter', | 169 'DoPostUploadExecuter', 'DoPresubmitChecks', 'GetPostUploadExecuter', |
170 'GetTrySlavesExecuter', 'GitAffectedFile', 'CallCommand', 'CommandData', | 170 'GetTrySlavesExecuter', 'GitAffectedFile', 'CallCommand', 'CommandData', |
171 'GitChange', 'InputApi', 'ListRelevantPresubmitFiles', 'main', | 171 'GitChange', 'InputApi', 'ListRelevantPresubmitFiles', 'main', |
172 'NonexistantCannedCheckFilter', 'OutputApi', 'ParseFiles', | 172 'NonexistantCannedCheckFilter', 'OutputApi', 'ParseFiles', |
173 'PresubmitFailure', 'PresubmitExecuter', 'PresubmitOutput', 'ScanSubDirs', | 173 'PresubmitFailure', 'PresubmitExecuter', 'PresubmitOutput', 'ScanSubDirs', |
174 'SvnAffectedFile', 'SvnChange', 'cPickle', 'cpplint', 'cStringIO', | 174 'SvnAffectedFile', 'SvnChange', 'auth', 'cPickle', 'cpplint', 'cStringIO', |
175 'contextlib', 'canned_check_filter', 'fix_encoding', 'fnmatch', | 175 'contextlib', 'canned_check_filter', 'fix_encoding', 'fnmatch', |
176 'gclient_utils', 'glob', 'inspect', 'json', 'load_files', 'logging', | 176 'gclient_utils', 'glob', 'inspect', 'json', 'load_files', 'logging', |
177 'marshal', 'normpath', 'optparse', 'os', 'owners', 'pickle', | 177 'marshal', 'normpath', 'optparse', 'os', 'owners', 'pickle', |
178 'presubmit_canned_checks', 'random', 're', 'rietveld', 'scm', | 178 'presubmit_canned_checks', 'random', 're', 'rietveld', 'scm', |
179 'subprocess', 'sys', 'tempfile', 'time', 'traceback', 'types', 'unittest', | 179 'subprocess', 'sys', 'tempfile', 'time', 'traceback', 'types', 'unittest', |
180 'urllib2', 'warn', 'multiprocessing', 'DoGetTryMasters', | 180 'urllib2', 'warn', 'multiprocessing', 'DoGetTryMasters', |
181 'GetTryMastersExecuter', 'itertools', | 181 'GetTryMastersExecuter', 'itertools', |
182 ] | 182 ] |
183 # If this test fails, you should add the relevant test. | 183 # If this test fails, you should add the relevant test. |
184 self.compareMembers(presubmit, members) | 184 self.compareMembers(presubmit, members) |
(...skipping 2682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2867 owners_check=False) | 2867 owners_check=False) |
2868 self.assertEqual(1, len(results)) | 2868 self.assertEqual(1, len(results)) |
2869 self.assertEqual( | 2869 self.assertEqual( |
2870 'Found line ending with white spaces in:', results[0]._message) | 2870 'Found line ending with white spaces in:', results[0]._message) |
2871 self.checkstdout('') | 2871 self.checkstdout('') |
2872 | 2872 |
2873 | 2873 |
2874 if __name__ == '__main__': | 2874 if __name__ == '__main__': |
2875 import unittest | 2875 import unittest |
2876 unittest.main() | 2876 unittest.main() |
OLD | NEW |