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

Side by Side Diff: tests/git_cl_test.py

Issue 1156223008: Added message when upstream branch is gone. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Fixed tests Created 5 years, 6 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
« no previous file with comments | « git_cl.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 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 self.calls = [] 79 self.calls = []
80 self._calls_done = 0 80 self._calls_done = 0
81 self.mock(subprocess2, 'call', self._mocked_call) 81 self.mock(subprocess2, 'call', self._mocked_call)
82 self.mock(subprocess2, 'check_call', self._mocked_call) 82 self.mock(subprocess2, 'check_call', self._mocked_call)
83 self.mock(subprocess2, 'check_output', self._mocked_call) 83 self.mock(subprocess2, 'check_output', self._mocked_call)
84 self.mock(subprocess2, 'communicate', self._mocked_call) 84 self.mock(subprocess2, 'communicate', self._mocked_call)
85 self.mock(git_common, 'is_dirty_git_tree', lambda x: False) 85 self.mock(git_common, 'is_dirty_git_tree', lambda x: False)
86 self.mock(git_common, 'get_or_create_merge_base', 86 self.mock(git_common, 'get_or_create_merge_base',
87 lambda *a: ( 87 lambda *a: (
88 self._mocked_call(['get_or_create_merge_base']+list(a)))) 88 self._mocked_call(['get_or_create_merge_base']+list(a))))
89 self.mock(git_cl, 'BranchExists', lambda _: True)
89 self.mock(git_cl, 'FindCodereviewSettingsFile', lambda: '') 90 self.mock(git_cl, 'FindCodereviewSettingsFile', lambda: '')
90 self.mock(git_cl, 'ask_for_data', self._mocked_call) 91 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, 'post', self._mocked_call)
92 self.mock(git_cl.breakpad, 'SendStack', self._mocked_call) 93 self.mock(git_cl.breakpad, 'SendStack', self._mocked_call)
93 self.mock(git_cl.presubmit_support, 'DoPresubmitChecks', PresubmitMock) 94 self.mock(git_cl.presubmit_support, 'DoPresubmitChecks', PresubmitMock)
94 self.mock(git_cl.rietveld, 'Rietveld', RietveldMock) 95 self.mock(git_cl.rietveld, 'Rietveld', RietveldMock)
95 self.mock(git_cl.rietveld, 'CachingRietveld', RietveldMock) 96 self.mock(git_cl.rietveld, 'CachingRietveld', RietveldMock)
96 self.mock(git_cl.upload, 'RealMain', self.fail) 97 self.mock(git_cl.upload, 'RealMain', self.fail)
97 self.mock(git_cl.watchlists, 'Watchlists', WatchlistsMock) 98 self.mock(git_cl.watchlists, 'Watchlists', WatchlistsMock)
98 self.mock(git_cl.auth, 'get_authenticator_for_host', AuthenticatorMock) 99 self.mock(git_cl.auth, 'get_authenticator_for_host', AuthenticatorMock)
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after
906 self.calls += [ 907 self.calls += [
907 ((['git', 'apply', '--index', '-p0', '--3way'],), '', 908 ((['git', 'apply', '--index', '-p0', '--3way'],), '',
908 subprocess2.CalledProcessError(1, '', '', '', '')), 909 subprocess2.CalledProcessError(1, '', '', '', '')),
909 ] 910 ]
910 self.assertNotEqual(git_cl.main(['patch', '123456']), 0) 911 self.assertNotEqual(git_cl.main(['patch', '123456']), 0)
911 912
912 if __name__ == '__main__': 913 if __name__ == '__main__':
913 git_cl.logging.basicConfig( 914 git_cl.logging.basicConfig(
914 level=git_cl.logging.DEBUG if '-v' in sys.argv else git_cl.logging.ERROR) 915 level=git_cl.logging.DEBUG if '-v' in sys.argv else git_cl.logging.ERROR)
915 unittest.main() 916 unittest.main()
OLDNEW
« no previous file with comments | « git_cl.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698