Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1508)

Side by Side Diff: tests/presubmit_unittest.py

Issue 949273002: Add ability to specify and run post upload hooks (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Fix tests and cleanup Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« presubmit_support.py ('K') | « tests/git_cl_test.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 self.mox.StubOutWithMock(presubmit.scm.SVN, 'GenerateDiff') 156 self.mox.StubOutWithMock(presubmit.scm.SVN, 'GenerateDiff')
157 self.mox.StubOutWithMock(presubmit.scm.GIT, 'GenerateDiff') 157 self.mox.StubOutWithMock(presubmit.scm.GIT, 'GenerateDiff')
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.maxDiff = None
166 self.mox.ReplayAll() 167 self.mox.ReplayAll()
167 members = [ 168 members = [
168 'AffectedFile', 'Change', 'DoGetTrySlaves', 'DoPresubmitChecks', 169 'AffectedFile', 'Change', 'DoGetTrySlaves',
170 'DoPostUploadExecuter', 'DoPresubmitChecks', 'GetPostUploadExecuter',
169 'GetTrySlavesExecuter', 'GitAffectedFile', 'CallCommand', 'CommandData', 171 'GetTrySlavesExecuter', 'GitAffectedFile', 'CallCommand', 'CommandData',
170 'GitChange', 'InputApi', 'ListRelevantPresubmitFiles', 'Main', 172 'GitChange', 'InputApi', 'ListRelevantPresubmitFiles', 'Main',
171 'NonexistantCannedCheckFilter', 'OutputApi', 'ParseFiles', 173 'NonexistantCannedCheckFilter', 'OutputApi', 'ParseFiles',
172 'PresubmitFailure', 'PresubmitExecuter', 'PresubmitOutput', 'ScanSubDirs', 174 'PresubmitFailure', 'PresubmitExecuter', 'PresubmitOutput', 'ScanSubDirs',
173 'SvnAffectedFile', 'SvnChange', 'cPickle', 'cpplint', 'cStringIO', 175 'SvnAffectedFile', 'SvnChange', 'cPickle', 'cpplint', 'cStringIO',
174 'contextlib', 'canned_check_filter', 'fix_encoding', 'fnmatch', 176 'contextlib', 'canned_check_filter', 'fix_encoding', 'fnmatch',
175 'gclient_utils', 'glob', 'inspect', 'json', 'load_files', 'logging', 177 'gclient_utils', 'glob', 'inspect', 'json', 'load_files', 'logging',
176 'marshal', 'normpath', 'optparse', 'os', 'owners', 'pickle', 178 'marshal', 'normpath', 'optparse', 'os', 'owners', 'pickle',
177 'presubmit_canned_checks', 'random', 're', 'rietveld', 'scm', 179 'presubmit_canned_checks', 'random', 're', 'rietveld', 'scm',
178 'subprocess', 'sys', 'tempfile', 'time', 'traceback', 'types', 'unittest', 180 'subprocess', 'sys', 'tempfile', 'time', 'traceback', 'types', 'unittest',
(...skipping 2687 matching lines...) Expand 10 before | Expand all | Expand 10 after
2866 owners_check=False) 2868 owners_check=False)
2867 self.assertEqual(1, len(results)) 2869 self.assertEqual(1, len(results))
2868 self.assertEqual( 2870 self.assertEqual(
2869 'Found line ending with white spaces in:', results[0]._message) 2871 'Found line ending with white spaces in:', results[0]._message)
2870 self.checkstdout('') 2872 self.checkstdout('')
2871 2873
2872 2874
2873 if __name__ == '__main__': 2875 if __name__ == '__main__':
2874 import unittest 2876 import unittest
2875 unittest.main() 2877 unittest.main()
OLDNEW
« presubmit_support.py ('K') | « tests/git_cl_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698