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

Side by Side Diff: tests/git_cl_test.py

Issue 1687923002: Finally get rid of depot_tools' breakpad. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: add no-op breakpad.py Created 4 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « tests/breakpad_unittest.py ('k') | tests/trychange_unittest.py » ('j') | 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 git_cl.py.""" 6 """Unit tests for git_cl.py."""
7 7
8 import os 8 import os
9 import StringIO 9 import StringIO
10 import stat 10 import stat
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 self.mock(subprocess2, 'check_call', self._mocked_call) 81 self.mock(subprocess2, 'check_call', self._mocked_call)
82 self.mock(subprocess2, 'check_output', self._mocked_call) 82 self.mock(subprocess2, 'check_output', self._mocked_call)
83 self.mock(subprocess2, 'communicate', self._mocked_call) 83 self.mock(subprocess2, 'communicate', self._mocked_call)
84 self.mock(git_common, 'is_dirty_git_tree', lambda x: False) 84 self.mock(git_common, 'is_dirty_git_tree', lambda x: False)
85 self.mock(git_common, 'get_or_create_merge_base', 85 self.mock(git_common, 'get_or_create_merge_base',
86 lambda *a: ( 86 lambda *a: (
87 self._mocked_call(['get_or_create_merge_base']+list(a)))) 87 self._mocked_call(['get_or_create_merge_base']+list(a))))
88 self.mock(git_cl, 'BranchExists', lambda _: True) 88 self.mock(git_cl, 'BranchExists', lambda _: True)
89 self.mock(git_cl, 'FindCodereviewSettingsFile', lambda: '') 89 self.mock(git_cl, 'FindCodereviewSettingsFile', lambda: '')
90 self.mock(git_cl, 'ask_for_data', self._mocked_call) 90 self.mock(git_cl, 'ask_for_data', self._mocked_call)
91 self.mock(git_cl.breakpad, 'post', self._mocked_call)
92 self.mock(git_cl.breakpad, 'SendStack', self._mocked_call)
93 self.mock(git_cl.presubmit_support, 'DoPresubmitChecks', PresubmitMock) 91 self.mock(git_cl.presubmit_support, 'DoPresubmitChecks', PresubmitMock)
94 self.mock(git_cl.rietveld, 'Rietveld', RietveldMock) 92 self.mock(git_cl.rietveld, 'Rietveld', RietveldMock)
95 self.mock(git_cl.rietveld, 'CachingRietveld', RietveldMock) 93 self.mock(git_cl.rietveld, 'CachingRietveld', RietveldMock)
96 self.mock(git_cl.upload, 'RealMain', self.fail) 94 self.mock(git_cl.upload, 'RealMain', self.fail)
97 self.mock(git_cl.watchlists, 'Watchlists', WatchlistsMock) 95 self.mock(git_cl.watchlists, 'Watchlists', WatchlistsMock)
98 self.mock(git_cl.auth, 'get_authenticator_for_host', AuthenticatorMock) 96 self.mock(git_cl.auth, 'get_authenticator_for_host', AuthenticatorMock)
99 # It's important to reset settings to not have inter-tests interference. 97 # It's important to reset settings to not have inter-tests interference.
100 git_cl.settings = None 98 git_cl.settings = None
101 99
102 def tearDown(self): 100 def tearDown(self):
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 ((['git', 'config', 'rietveld.tree-status-url'],), ''), 324 ((['git', 'config', 'rietveld.tree-status-url'],), ''),
327 ] 325 ]
328 326
329 @classmethod 327 @classmethod
330 def _dcommit_calls_bypassed(cls): 328 def _dcommit_calls_bypassed(cls):
331 return [ 329 return [
332 ((['git', 330 ((['git',
333 'config', 'branch.working.rietveldissue'],), '12345'), 331 'config', 'branch.working.rietveldissue'],), '12345'),
334 ((['git', 'config', 'branch.working.rietveldserver'],), 332 ((['git', 'config', 'branch.working.rietveldserver'],),
335 'codereview.example.com'), 333 'codereview.example.com'),
336 ((['git', 'config', 'rietveld.tree-status-url'],), ''),
337 (('GitClHooksBypassedCommit',
338 'Issue https://codereview.example.com/12345 bypassed hook when '
339 'committing (tree status was "unset")'), None),
340 ] 334 ]
341 335
342 @classmethod 336 @classmethod
343 def _dcommit_calls_3(cls): 337 def _dcommit_calls_3(cls):
344 return [ 338 return [
345 ((['git', 339 ((['git',
346 'diff', '--no-ext-diff', '--stat', '--find-copies-harder', 340 'diff', '--no-ext-diff', '--stat', '--find-copies-harder',
347 '-l100000', '-C50', 'fake_ancestor_sha', 341 '-l100000', '-C50', 'fake_ancestor_sha',
348 'refs/heads/working'],), 342 'refs/heads/working'],),
349 (' PRESUBMIT.py | 2 +-\n' 343 (' PRESUBMIT.py | 2 +-\n'
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
955 self.calls += [ 949 self.calls += [
956 ((['git', 'apply', '--index', '-p0', '--3way'],), '', 950 ((['git', 'apply', '--index', '-p0', '--3way'],), '',
957 subprocess2.CalledProcessError(1, '', '', '', '')), 951 subprocess2.CalledProcessError(1, '', '', '', '')),
958 ] 952 ]
959 self.assertNotEqual(git_cl.main(['patch', '123456']), 0) 953 self.assertNotEqual(git_cl.main(['patch', '123456']), 0)
960 954
961 if __name__ == '__main__': 955 if __name__ == '__main__':
962 git_cl.logging.basicConfig( 956 git_cl.logging.basicConfig(
963 level=git_cl.logging.DEBUG if '-v' in sys.argv else git_cl.logging.ERROR) 957 level=git_cl.logging.DEBUG if '-v' in sys.argv else git_cl.logging.ERROR)
964 unittest.main() 958 unittest.main()
OLDNEW
« no previous file with comments | « tests/breakpad_unittest.py ('k') | tests/trychange_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698