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

Side by Side Diff: tests/git_cl_test.py

Issue 1882833005: Use hyphen for gerrit.skip-ensure-authenticated (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: 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 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 self.mock(git_cl.sys, 'stdout', StringIO.StringIO()) 673 self.mock(git_cl.sys, 'stdout', StringIO.StringIO())
674 self.calls = ( 674 self.calls = (
675 self._dcommit_calls_1() + 675 self._dcommit_calls_1() +
676 self._dcommit_calls_bypassed() + 676 self._dcommit_calls_bypassed() +
677 self._dcommit_calls_3()) 677 self._dcommit_calls_3())
678 git_cl.main(['dcommit', '--bypass-hooks']) 678 git_cl.main(['dcommit', '--bypass-hooks'])
679 679
680 680
681 @classmethod 681 @classmethod
682 def _gerrit_ensure_auth_calls(cls, issue=None, skip_auth_check=False): 682 def _gerrit_ensure_auth_calls(cls, issue=None, skip_auth_check=False):
683 cmd = ['git', 'config', '--bool', 'gerrit.skip_ensure_authenticated'] 683 cmd = ['git', 'config', '--bool', 'gerrit.skip-ensure-authenticated']
684 if skip_auth_check: 684 if skip_auth_check:
685 return [((cmd, ), 'true')] 685 return [((cmd, ), 'true')]
686 686
687 calls = [((cmd, ), '', subprocess2.CalledProcessError(1, '', '', '', ''))] 687 calls = [((cmd, ), '', subprocess2.CalledProcessError(1, '', '', '', ''))]
688 if issue: 688 if issue:
689 calls.extend([ 689 calls.extend([
690 ((['git', 'config', 'branch.master.gerritserver'],), ''), 690 ((['git', 'config', 'branch.master.gerritserver'],), ''),
691 ]) 691 ])
692 calls.extend([ 692 calls.extend([
693 ((['git', 'config', 'branch.master.merge'],), 'refs/heads/master'), 693 ((['git', 'config', 'branch.master.merge'],), 'refs/heads/master'),
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after
1375 # TODO(tandrii): consider testing just set-commit and set-commit --clear, 1375 # TODO(tandrii): consider testing just set-commit and set-commit --clear,
1376 # but without copy-pasting tons of expectations, as modifying them later is 1376 # but without copy-pasting tons of expectations, as modifying them later is
1377 # super tedious. 1377 # super tedious.
1378 self.assertEqual(0, git_cl.main(['set-commit', '-d'])) 1378 self.assertEqual(0, git_cl.main(['set-commit', '-d']))
1379 1379
1380 1380
1381 if __name__ == '__main__': 1381 if __name__ == '__main__':
1382 git_cl.logging.basicConfig( 1382 git_cl.logging.basicConfig(
1383 level=git_cl.logging.DEBUG if '-v' in sys.argv else git_cl.logging.ERROR) 1383 level=git_cl.logging.DEBUG if '-v' in sys.argv else git_cl.logging.ERROR)
1384 unittest.main() 1384 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