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