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

Side by Side Diff: tests/git_cl_test.py

Issue 967453004: Stop defaulting unrecognized branches to master except for handful of special refs (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Create an alias map 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
« 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 804 matching lines...) Expand 10 before | Expand all | Expand 10 after
815 git_cl.GetTargetRef('origin', 'refs/remotes/origin/lkcr', 815 git_cl.GetTargetRef('origin', 'refs/remotes/origin/lkcr',
816 None, None)) 816 None, None))
817 self.assertEqual('refs/branch-heads/123', 817 self.assertEqual('refs/branch-heads/123',
818 git_cl.GetTargetRef('origin', 818 git_cl.GetTargetRef('origin',
819 'refs/remotes/branch-heads/123', 819 'refs/remotes/branch-heads/123',
820 None, None)) 820 None, None))
821 self.assertEqual('refs/diff/test', 821 self.assertEqual('refs/diff/test',
822 git_cl.GetTargetRef('origin', 822 git_cl.GetTargetRef('origin',
823 'refs/remotes/origin/refs/diff/test', 823 'refs/remotes/origin/refs/diff/test',
824 None, None)) 824 None, None))
825 self.assertEqual('refs/heads/chrome/m42',
826 git_cl.GetTargetRef('origin',
827 'refs/remotes/origin/chrome/m42',
828 None, None))
825 829
826 # Check target refs for user-specified target branch. 830 # Check target refs for user-specified target branch.
827 for branch in ('branch-heads/123', 'remotes/branch-heads/123', 831 for branch in ('branch-heads/123', 'remotes/branch-heads/123',
828 'refs/remotes/branch-heads/123'): 832 'refs/remotes/branch-heads/123'):
829 self.assertEqual('refs/branch-heads/123', 833 self.assertEqual('refs/branch-heads/123',
830 git_cl.GetTargetRef('origin', 834 git_cl.GetTargetRef('origin',
831 'refs/remotes/origin/master', 835 'refs/remotes/origin/master',
832 branch, None)) 836 branch, None))
833 for branch in ('origin/master', 'remotes/origin/master', 837 for branch in ('origin/master', 'remotes/origin/master',
834 'refs/remotes/origin/master'): 838 'refs/remotes/origin/master'):
(...skipping 10 matching lines...) Expand all
845 # Check target refs for pending prefix. 849 # Check target refs for pending prefix.
846 self.assertEqual('prefix/heads/master', 850 self.assertEqual('prefix/heads/master',
847 git_cl.GetTargetRef('origin', 'refs/remotes/origin/master', 851 git_cl.GetTargetRef('origin', 'refs/remotes/origin/master',
848 None, 'prefix/')) 852 None, 'prefix/'))
849 853
850 854
851 if __name__ == '__main__': 855 if __name__ == '__main__':
852 git_cl.logging.basicConfig( 856 git_cl.logging.basicConfig(
853 level=git_cl.logging.DEBUG if '-v' in sys.argv else git_cl.logging.ERROR) 857 level=git_cl.logging.DEBUG if '-v' in sys.argv else git_cl.logging.ERROR)
854 unittest.main() 858 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