| 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 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 ((['git', 'branch', '-D', 'git-cl-commit'],), ''), | 343 ((['git', 'branch', '-D', 'git-cl-commit'],), ''), |
| 344 ((['git', 'show-ref', '--quiet', '--verify', | 344 ((['git', 'show-ref', '--quiet', '--verify', |
| 345 'refs/heads/git-cl-cherry-pick'],), ''), | 345 'refs/heads/git-cl-cherry-pick'],), ''), |
| 346 ((['git', 'rev-parse', '--show-cdup'],), '\n'), | 346 ((['git', 'rev-parse', '--show-cdup'],), '\n'), |
| 347 ((['git', 'checkout', '-q', '-b', 'git-cl-commit'],), ''), | 347 ((['git', 'checkout', '-q', '-b', 'git-cl-commit'],), ''), |
| 348 ((['git', 'reset', '--soft', 'fake_ancestor_sha'],), ''), | 348 ((['git', 'reset', '--soft', 'fake_ancestor_sha'],), ''), |
| 349 ((['git', 'commit', '-m', | 349 ((['git', 'commit', '-m', |
| 350 'Issue: 12345\n\nR=john@chromium.org\n\n' | 350 'Issue: 12345\n\nR=john@chromium.org\n\n' |
| 351 'Review URL: https://codereview.example.com/12345'],), | 351 'Review URL: https://codereview.example.com/12345'],), |
| 352 ''), | 352 ''), |
| 353 ((['git', 'config', 'rietveld.force-https-commit-url'],), ''), |
| 353 ((['git', | 354 ((['git', |
| 354 'svn', 'dcommit', '-C50', '--no-rebase', '--rmdir'],), | 355 'svn', 'dcommit', '-C50', '--no-rebase', '--rmdir'],), |
| 355 (('', None), 0)), | 356 (('', None), 0)), |
| 356 ((['git', 'checkout', '-q', 'working'],), ''), | 357 ((['git', 'checkout', '-q', 'working'],), ''), |
| 357 ((['git', 'branch', '-D', 'git-cl-commit'],), ''), | 358 ((['git', 'branch', '-D', 'git-cl-commit'],), ''), |
| 358 ] | 359 ] |
| 359 | 360 |
| 360 @staticmethod | 361 @staticmethod |
| 361 def _cmd_line(description, args, similarity, find_copies, private): | 362 def _cmd_line(description, args, similarity, find_copies, private): |
| 362 """Returns the upload command line passed to upload.RealMain().""" | 363 """Returns the upload command line passed to upload.RealMain().""" |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 680 'rietveld.private'],), ''), | 681 'rietveld.private'],), ''), |
| 681 ((['git', 'config', '--unset-all', | 682 ((['git', 'config', '--unset-all', |
| 682 'rietveld.tree-status-url'],), ''), | 683 'rietveld.tree-status-url'],), ''), |
| 683 ((['git', 'config', '--unset-all', | 684 ((['git', 'config', '--unset-all', |
| 684 'rietveld.viewvc-url'],), ''), | 685 'rietveld.viewvc-url'],), ''), |
| 685 ((['git', 'config', '--unset-all', | 686 ((['git', 'config', '--unset-all', |
| 686 'rietveld.bug-prefix'],), ''), | 687 'rietveld.bug-prefix'],), ''), |
| 687 ((['git', 'config', '--unset-all', | 688 ((['git', 'config', '--unset-all', |
| 688 'rietveld.cpplint-regex'],), ''), | 689 'rietveld.cpplint-regex'],), ''), |
| 689 ((['git', 'config', '--unset-all', | 690 ((['git', 'config', '--unset-all', |
| 691 'rietveld.force-https-commit-url'],), ''), |
| 692 ((['git', 'config', '--unset-all', |
| 690 'rietveld.cpplint-ignore-regex'],), ''), | 693 'rietveld.cpplint-ignore-regex'],), ''), |
| 691 ((['git', 'config', '--unset-all', | 694 ((['git', 'config', '--unset-all', |
| 692 'rietveld.project'],), ''), | 695 'rietveld.project'],), ''), |
| 693 ((['git', 'config', '--unset-all', | 696 ((['git', 'config', '--unset-all', |
| 694 'rietveld.pending-ref-prefix'],), ''), | 697 'rietveld.pending-ref-prefix'],), ''), |
| 695 ((['git', 'config', 'gerrit.host', | 698 ((['git', 'config', 'gerrit.host', |
| 696 'gerrit.chromium.org'],), ''), | 699 'gerrit.chromium.org'],), ''), |
| 697 # DownloadHooks(False) | 700 # DownloadHooks(False) |
| 698 ((['git', 'config', 'gerrit.host'],), | 701 ((['git', 'config', 'gerrit.host'],), |
| 699 'gerrit.chromium.org'), | 702 'gerrit.chromium.org'), |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 750 for orig, reviewers, _expected in data: | 753 for orig, reviewers, _expected in data: |
| 751 obj = git_cl.ChangeDescription(orig) | 754 obj = git_cl.ChangeDescription(orig) |
| 752 obj.update_reviewers(reviewers) | 755 obj.update_reviewers(reviewers) |
| 753 actual.append(obj.description) | 756 actual.append(obj.description) |
| 754 self.assertEqual(expected, actual) | 757 self.assertEqual(expected, actual) |
| 755 | 758 |
| 756 if __name__ == '__main__': | 759 if __name__ == '__main__': |
| 757 git_cl.logging.basicConfig( | 760 git_cl.logging.basicConfig( |
| 758 level=git_cl.logging.DEBUG if '-v' in sys.argv else git_cl.logging.ERROR) | 761 level=git_cl.logging.DEBUG if '-v' in sys.argv else git_cl.logging.ERROR) |
| 759 unittest.main() | 762 unittest.main() |
| OLD | NEW |