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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 ((['git', 'config', 'branch.working.rietveldserver'],), | 185 ((['git', 'config', 'branch.working.rietveldserver'],), |
186 'codereview.example.com'), | 186 'codereview.example.com'), |
187 (('GitClHooksBypassedCommit', | 187 (('GitClHooksBypassedCommit', |
188 'Issue https://codereview.example.com/12345 bypassed hook when ' | 188 'Issue https://codereview.example.com/12345 bypassed hook when ' |
189 'committing'), None), | 189 'committing'), None), |
190 ] | 190 ] |
191 | 191 |
192 @classmethod | 192 @classmethod |
193 def _dcommit_calls_3(cls): | 193 def _dcommit_calls_3(cls): |
194 return [ | 194 return [ |
195 ((['git', 'diff', '--stat', 'refs/remotes/origin/master', | 195 ((['git', 'diff', '--no-ext-diff', '--stat', '--find-copies-harder', |
196 'refs/heads/working'],), | 196 'refs/remotes/origin/master', 'refs/heads/working'],), |
197 (' PRESUBMIT.py | 2 +-\n' | 197 (' PRESUBMIT.py | 2 +-\n' |
198 ' 1 files changed, 1 insertions(+), 1 deletions(-)\n')), | 198 ' 1 files changed, 1 insertions(+), 1 deletions(-)\n')), |
199 (('About to commit; enter to confirm.',), None), | 199 (('About to commit; enter to confirm.',), None), |
200 ((['git', 'show-ref', '--quiet', '--verify', | 200 ((['git', 'show-ref', '--quiet', '--verify', |
201 'refs/heads/git-cl-commit'],), | 201 'refs/heads/git-cl-commit'],), |
202 (('', None), 0)), | 202 (('', None), 0)), |
203 ((['git', 'branch', '-D', 'git-cl-commit'],), ''), | 203 ((['git', 'branch', '-D', 'git-cl-commit'],), ''), |
204 ((['git', 'show-ref', '--quiet', '--verify', | 204 ((['git', 'show-ref', '--quiet', '--verify', |
205 'refs/heads/git-cl-cherry-pick'],), ''), | 205 'refs/heads/git-cl-cherry-pick'],), ''), |
206 ((['git', 'rev-parse', '--show-cdup'],), '\n'), | 206 ((['git', 'rev-parse', '--show-cdup'],), '\n'), |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 ((['git', 'config', 'rietveld.viewvc-url'],), ''), | 458 ((['git', 'config', 'rietveld.viewvc-url'],), ''), |
459 (('ViewVC URL:',), ''), | 459 (('ViewVC URL:',), ''), |
460 # DownloadHooks(True) | 460 # DownloadHooks(True) |
461 ((commit_msg_path, os.X_OK,), True), | 461 ((commit_msg_path, os.X_OK,), True), |
462 ] | 462 ] |
463 git_cl.main(['config']) | 463 git_cl.main(['config']) |
464 | 464 |
465 | 465 |
466 if __name__ == '__main__': | 466 if __name__ == '__main__': |
467 unittest.main() | 467 unittest.main() |
OLD | NEW |