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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 | 158 |
159 | 159 |
160 class PresubmitUnittest(PresubmitTestsBase): | 160 class PresubmitUnittest(PresubmitTestsBase): |
161 """General presubmit_support.py tests (excluding InputApi and OutputApi).""" | 161 """General presubmit_support.py tests (excluding InputApi and OutputApi).""" |
162 | 162 |
163 _INHERIT_SETTINGS = 'inherit-review-settings-ok' | 163 _INHERIT_SETTINGS = 'inherit-review-settings-ok' |
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', 'DoPresubmitChecks', | 168 'AffectedFile', 'Change', 'DoGetTrySlaves', |
| 169 'DoPostUploadExecuter', 'DoPresubmitChecks', 'GetPostUploadExecuter', |
169 'GetTrySlavesExecuter', 'GitAffectedFile', 'CallCommand', 'CommandData', | 170 'GetTrySlavesExecuter', 'GitAffectedFile', 'CallCommand', 'CommandData', |
170 'GitChange', 'InputApi', 'ListRelevantPresubmitFiles', 'Main', | 171 'GitChange', 'InputApi', 'ListRelevantPresubmitFiles', 'Main', |
171 'NonexistantCannedCheckFilter', 'OutputApi', 'ParseFiles', | 172 'NonexistantCannedCheckFilter', 'OutputApi', 'ParseFiles', |
172 'PresubmitFailure', 'PresubmitExecuter', 'PresubmitOutput', 'ScanSubDirs', | 173 'PresubmitFailure', 'PresubmitExecuter', 'PresubmitOutput', 'ScanSubDirs', |
173 'SvnAffectedFile', 'SvnChange', 'cPickle', 'cpplint', 'cStringIO', | 174 'SvnAffectedFile', 'SvnChange', 'cPickle', 'cpplint', 'cStringIO', |
174 'contextlib', 'canned_check_filter', 'fix_encoding', 'fnmatch', | 175 'contextlib', 'canned_check_filter', 'fix_encoding', 'fnmatch', |
175 'gclient_utils', 'glob', 'inspect', 'json', 'load_files', 'logging', | 176 'gclient_utils', 'glob', 'inspect', 'json', 'load_files', 'logging', |
176 'marshal', 'normpath', 'optparse', 'os', 'owners', 'pickle', | 177 'marshal', 'normpath', 'optparse', 'os', 'owners', 'pickle', |
177 'presubmit_canned_checks', 'random', 're', 'rietveld', 'scm', | 178 'presubmit_canned_checks', 'random', 're', 'rietveld', 'scm', |
178 'subprocess', 'sys', 'tempfile', 'time', 'traceback', 'types', 'unittest', | 179 'subprocess', 'sys', 'tempfile', 'time', 'traceback', 'types', 'unittest', |
(...skipping 2687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2866 owners_check=False) | 2867 owners_check=False) |
2867 self.assertEqual(1, len(results)) | 2868 self.assertEqual(1, len(results)) |
2868 self.assertEqual( | 2869 self.assertEqual( |
2869 'Found line ending with white spaces in:', results[0]._message) | 2870 'Found line ending with white spaces in:', results[0]._message) |
2870 self.checkstdout('') | 2871 self.checkstdout('') |
2871 | 2872 |
2872 | 2873 |
2873 if __name__ == '__main__': | 2874 if __name__ == '__main__': |
2874 import unittest | 2875 import unittest |
2875 unittest.main() | 2876 unittest.main() |
OLD | NEW |