| 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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 'refs/heads/git-cl-commit'],), | 352 'refs/heads/git-cl-commit'],), |
| 353 (('', None), 0)), | 353 (('', None), 0)), |
| 354 ((['git', 'branch', '-D', 'git-cl-commit'],), ''), | 354 ((['git', 'branch', '-D', 'git-cl-commit'],), ''), |
| 355 ((['git', 'show-ref', '--quiet', '--verify', | 355 ((['git', 'show-ref', '--quiet', '--verify', |
| 356 'refs/heads/git-cl-cherry-pick'],), ''), | 356 'refs/heads/git-cl-cherry-pick'],), ''), |
| 357 ((['git', 'rev-parse', '--show-cdup'],), '\n'), | 357 ((['git', 'rev-parse', '--show-cdup'],), '\n'), |
| 358 ((['git', 'checkout', '-q', '-b', 'git-cl-commit'],), ''), | 358 ((['git', 'checkout', '-q', '-b', 'git-cl-commit'],), ''), |
| 359 ((['git', 'reset', '--soft', 'fake_ancestor_sha'],), ''), | 359 ((['git', 'reset', '--soft', 'fake_ancestor_sha'],), ''), |
| 360 ((['git', 'commit', '-m', | 360 ((['git', 'commit', '-m', |
| 361 'Issue: 12345\n\nR=john@chromium.org\n\n' | 361 'Issue: 12345\n\nR=john@chromium.org\n\n' |
| 362 'Review URL: https://codereview.example.com/12345'],), | 362 'Review URL: https://codereview.example.com/12345.'],), |
| 363 ''), | 363 ''), |
| 364 ((['git', 'config', 'rietveld.force-https-commit-url'],), ''), | 364 ((['git', 'config', 'rietveld.force-https-commit-url'],), ''), |
| 365 ((['git', | 365 ((['git', |
| 366 'svn', 'dcommit', '-C50', '--no-rebase', '--rmdir'],), | 366 'svn', 'dcommit', '-C50', '--no-rebase', '--rmdir'],), |
| 367 (('', None), 0)), | 367 (('', None), 0)), |
| 368 ((['git', 'checkout', '-q', 'working'],), ''), | 368 ((['git', 'checkout', '-q', 'working'],), ''), |
| 369 ((['git', 'branch', '-D', 'git-cl-commit'],), ''), | 369 ((['git', 'branch', '-D', 'git-cl-commit'],), ''), |
| 370 ] | 370 ] |
| 371 | 371 |
| 372 @staticmethod | 372 @staticmethod |
| (...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 906 self.calls += [ | 906 self.calls += [ |
| 907 ((['git', 'apply', '--index', '-p0', '--3way'],), '', | 907 ((['git', 'apply', '--index', '-p0', '--3way'],), '', |
| 908 subprocess2.CalledProcessError(1, '', '', '', '')), | 908 subprocess2.CalledProcessError(1, '', '', '', '')), |
| 909 ] | 909 ] |
| 910 self.assertNotEqual(git_cl.main(['patch', '123456']), 0) | 910 self.assertNotEqual(git_cl.main(['patch', '123456']), 0) |
| 911 | 911 |
| 912 if __name__ == '__main__': | 912 if __name__ == '__main__': |
| 913 git_cl.logging.basicConfig( | 913 git_cl.logging.basicConfig( |
| 914 level=git_cl.logging.DEBUG if '-v' in sys.argv else git_cl.logging.ERROR) | 914 level=git_cl.logging.DEBUG if '-v' in sys.argv else git_cl.logging.ERROR) |
| 915 unittest.main() | 915 unittest.main() |
| OLD | NEW |