OLD | NEW |
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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 ((['git', 'checkout', '-q', 'working'],), ''), | 358 ((['git', 'checkout', '-q', 'working'],), ''), |
359 ((['git', 'branch', '-D', 'git-cl-commit'],), ''), | 359 ((['git', 'branch', '-D', 'git-cl-commit'],), ''), |
360 ] | 360 ] |
361 | 361 |
362 @staticmethod | 362 @staticmethod |
363 def _cmd_line(description, args, similarity, find_copies, private): | 363 def _cmd_line(description, args, similarity, find_copies, private): |
364 """Returns the upload command line passed to upload.RealMain().""" | 364 """Returns the upload command line passed to upload.RealMain().""" |
365 return [ | 365 return [ |
366 'upload', '--assume_yes', '--server', | 366 'upload', '--assume_yes', '--server', |
367 'https://codereview.example.com', | 367 'https://codereview.example.com', |
| 368 '--no-oauth2', '--auth-host-port', '8090', |
368 '--message', description | 369 '--message', description |
369 ] + args + [ | 370 ] + args + [ |
370 '--cc', 'joe@example.com', | 371 '--cc', 'joe@example.com', |
371 ] + (['--private'] if private else []) + [ | 372 ] + (['--private'] if private else []) + [ |
372 '--git_similarity', similarity or '50' | 373 '--git_similarity', similarity or '50' |
373 ] + (['--git_no_find_copies'] if find_copies == False else []) + [ | 374 ] + (['--git_no_find_copies'] if find_copies == False else []) + [ |
374 'fake_ancestor_sha', 'HEAD' | 375 'fake_ancestor_sha', 'HEAD' |
375 ] | 376 ] |
376 | 377 |
377 def _run_reviewer_test( | 378 def _run_reviewer_test( |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
849 # Check target refs for pending prefix. | 850 # Check target refs for pending prefix. |
850 self.assertEqual('prefix/heads/master', | 851 self.assertEqual('prefix/heads/master', |
851 git_cl.GetTargetRef('origin', 'refs/remotes/origin/master', | 852 git_cl.GetTargetRef('origin', 'refs/remotes/origin/master', |
852 None, 'prefix/')) | 853 None, 'prefix/')) |
853 | 854 |
854 | 855 |
855 if __name__ == '__main__': | 856 if __name__ == '__main__': |
856 git_cl.logging.basicConfig( | 857 git_cl.logging.basicConfig( |
857 level=git_cl.logging.DEBUG if '-v' in sys.argv else git_cl.logging.ERROR) | 858 level=git_cl.logging.DEBUG if '-v' in sys.argv else git_cl.logging.ERROR) |
858 unittest.main() | 859 unittest.main() |
OLD | NEW |