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

Side by Side Diff: tests/git_cl_test.py

Issue 1878613003: Fix git cl checkout when no branch has issues. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: actual fix Created 4 years, 8 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 1162 matching lines...) Expand 10 before | Expand all | Expand 10 after
1173 """Tests git cl checkout <issue>.""" 1173 """Tests git cl checkout <issue>."""
1174 self.calls = self._checkout_calls() 1174 self.calls = self._checkout_calls()
1175 self.calls += [((['git', 'checkout', 'some-fix'], ), '')] 1175 self.calls += [((['git', 'checkout', 'some-fix'], ), '')]
1176 self.assertEqual(0, git_cl.main(['checkout', '2222222222'])) 1176 self.assertEqual(0, git_cl.main(['checkout', '2222222222']))
1177 1177
1178 def test_checkout_not_found(self): 1178 def test_checkout_not_found(self):
1179 """Tests git cl checkout <issue>.""" 1179 """Tests git cl checkout <issue>."""
1180 self.calls = self._checkout_calls() 1180 self.calls = self._checkout_calls()
1181 self.assertEqual(1, git_cl.main(['checkout', '99999'])) 1181 self.assertEqual(1, git_cl.main(['checkout', '99999']))
1182 1182
1183 def test_checkout_no_branch_issues(self):
1184 """Tests git cl checkout <issue>."""
1185 self.calls = [
1186 ((['git', 'config', '--local', '--get-regexp',
1187 'branch\\..*\\.rietveldissue'], ), '',
1188 subprocess2.CalledProcessError(1, '', '', '', '')),
1189 ((['git', 'config', '--local', '--get-regexp',
1190 'branch\\..*\\.gerritissue'], ), '',
1191 subprocess2.CalledProcessError(1, '', '', '', '')),
1192
1193 ]
1194 self.assertEqual(1, git_cl.main(['checkout', '99999']))
1195
1183 1196
1184 if __name__ == '__main__': 1197 if __name__ == '__main__':
1185 git_cl.logging.basicConfig( 1198 git_cl.logging.basicConfig(
1186 level=git_cl.logging.DEBUG if '-v' in sys.argv else git_cl.logging.ERROR) 1199 level=git_cl.logging.DEBUG if '-v' in sys.argv else git_cl.logging.ERROR)
1187 unittest.main() 1200 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