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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 | 203 |
204 return [ | 204 return [ |
205 ((['git', 'config', 'core.editor'],), ''), | 205 ((['git', 'config', 'core.editor'],), ''), |
206 ] + cc_call + private_call + [ | 206 ] + cc_call + private_call + [ |
207 ((['git', 'config', 'branch.master.base-url'],), ''), | 207 ((['git', 'config', 'branch.master.base-url'],), ''), |
208 ((['git', | 208 ((['git', |
209 'config', '--local', '--get-regexp', '^svn-remote\\.'],), | 209 'config', '--local', '--get-regexp', '^svn-remote\\.'],), |
210 (('', None), 0)), | 210 (('', None), 0)), |
211 ((['git', 'rev-parse', '--show-cdup'],), ''), | 211 ((['git', 'rev-parse', '--show-cdup'],), ''), |
212 ((['git', 'svn', 'info'],), ''), | 212 ((['git', 'svn', 'info'],), ''), |
| 213 ((['git', 'config', 'rietveld.project'],), ''), |
213 ((['git', | 214 ((['git', |
214 'config', 'branch.master.rietveldissue', '1'],), ''), | 215 'config', 'branch.master.rietveldissue', '1'],), ''), |
215 ((['git', 'config', 'branch.master.rietveldserver', | 216 ((['git', 'config', 'branch.master.rietveldserver', |
216 'https://codereview.example.com'],), ''), | 217 'https://codereview.example.com'],), ''), |
217 ((['git', | 218 ((['git', |
218 'config', 'branch.master.rietveldpatchset', '2'],), ''), | 219 'config', 'branch.master.rietveldpatchset', '2'],), ''), |
219 ((['git', 'rev-parse', 'HEAD'],), 'hash'), | 220 ((['git', 'rev-parse', 'HEAD'],), 'hash'), |
220 ((['git', 'symbolic-ref', 'HEAD'],), 'hash'), | 221 ((['git', 'symbolic-ref', 'HEAD'],), 'hash'), |
221 ((['git', | 222 ((['git', |
222 'config', 'branch.hash.last-upload-hash', 'hash'],), ''), | 223 'config', 'branch.hash.last-upload-hash', 'hash'],), ''), |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
679 ((['git', 'config', '--unset-all', | 680 ((['git', 'config', '--unset-all', |
680 'rietveld.tree-status-url'],), ''), | 681 'rietveld.tree-status-url'],), ''), |
681 ((['git', 'config', '--unset-all', | 682 ((['git', 'config', '--unset-all', |
682 'rietveld.viewvc-url'],), ''), | 683 'rietveld.viewvc-url'],), ''), |
683 ((['git', 'config', '--unset-all', | 684 ((['git', 'config', '--unset-all', |
684 'rietveld.bug-prefix'],), ''), | 685 'rietveld.bug-prefix'],), ''), |
685 ((['git', 'config', '--unset-all', | 686 ((['git', 'config', '--unset-all', |
686 'rietveld.cpplint-regex'],), ''), | 687 'rietveld.cpplint-regex'],), ''), |
687 ((['git', 'config', '--unset-all', | 688 ((['git', 'config', '--unset-all', |
688 'rietveld.cpplint-ignore-regex'],), ''), | 689 'rietveld.cpplint-ignore-regex'],), ''), |
| 690 ((['git', 'config', '--unset-all', |
| 691 'rietveld.project'],), ''), |
689 ((['git', 'config', 'gerrit.host', | 692 ((['git', 'config', 'gerrit.host', |
690 'gerrit.chromium.org'],), ''), | 693 'gerrit.chromium.org'],), ''), |
691 # DownloadHooks(False) | 694 # DownloadHooks(False) |
692 ((['git', 'config', 'gerrit.host'],), | 695 ((['git', 'config', 'gerrit.host'],), |
693 'gerrit.chromium.org'), | 696 'gerrit.chromium.org'), |
694 ((['git', 'rev-parse', '--show-cdup'],), ''), | 697 ((['git', 'rev-parse', '--show-cdup'],), ''), |
695 ((commit_msg_path, os.X_OK,), False), | 698 ((commit_msg_path, os.X_OK,), False), |
696 (('https://gerrit-review.googlesource.com/tools/hooks/commit-msg', | 699 (('https://gerrit-review.googlesource.com/tools/hooks/commit-msg', |
697 commit_msg_path,), ''), | 700 commit_msg_path,), ''), |
698 ((commit_msg_path,), True), | 701 ((commit_msg_path,), True), |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
745 obj = git_cl.ChangeDescription(orig) | 748 obj = git_cl.ChangeDescription(orig) |
746 obj.update_reviewers(reviewers) | 749 obj.update_reviewers(reviewers) |
747 actual.append(obj.description) | 750 actual.append(obj.description) |
748 self.assertEqual(expected, actual) | 751 self.assertEqual(expected, actual) |
749 | 752 |
750 | 753 |
751 if __name__ == '__main__': | 754 if __name__ == '__main__': |
752 git_cl.logging.basicConfig( | 755 git_cl.logging.basicConfig( |
753 level=git_cl.logging.DEBUG if '-v' in sys.argv else git_cl.logging.ERROR) | 756 level=git_cl.logging.DEBUG if '-v' in sys.argv else git_cl.logging.ERROR) |
754 unittest.main() | 757 unittest.main() |
OLD | NEW |