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 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 description), | 595 description), |
596 ((['git', 'commit', '--amend', '-m', description],), | 596 ((['git', 'commit', '--amend', '-m', description],), |
597 ''), | 597 ''), |
598 ((['git', 'log', '--pretty=format:%s\n\n%b', | 598 ((['git', 'log', '--pretty=format:%s\n\n%b', |
599 'fake_ancestor_sha..HEAD'],), | 599 'fake_ancestor_sha..HEAD'],), |
600 description) | 600 description) |
601 ] | 601 ] |
602 if squash: | 602 if squash: |
603 ref_to_push = 'abcdef0123456789' | 603 ref_to_push = 'abcdef0123456789' |
604 calls += [ | 604 calls += [ |
605 ((['git', 'show', '--format=%s\n\n%b', '-s', | 605 ((['git', 'show', '--format=%B', '-s', |
606 'refs/heads/git_cl_uploads/master'],), | 606 'refs/heads/git_cl_uploads/master'],), |
607 (description, 0)), | 607 (description, 0)), |
608 ((['git', 'config', 'branch.master.merge'],), | 608 ((['git', 'config', 'branch.master.merge'],), |
609 'refs/heads/master'), | 609 'refs/heads/master'), |
610 ((['git', 'config', 'branch.master.remote'],), | 610 ((['git', 'config', 'branch.master.remote'],), |
611 'origin'), | 611 'origin'), |
612 ((['get_or_create_merge_base', 'master', 'master'],), | 612 ((['get_or_create_merge_base', 'master', 'master'],), |
613 'origin/master'), | 613 'origin/master'), |
614 ((['git', 'rev-parse', 'HEAD:'],), | 614 ((['git', 'rev-parse', 'HEAD:'],), |
615 '0123456789abcdef'), | 615 '0123456789abcdef'), |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
954 self.calls += [ | 954 self.calls += [ |
955 ((['git', 'apply', '--index', '-p0', '--3way'],), '', | 955 ((['git', 'apply', '--index', '-p0', '--3way'],), '', |
956 subprocess2.CalledProcessError(1, '', '', '', '')), | 956 subprocess2.CalledProcessError(1, '', '', '', '')), |
957 ] | 957 ] |
958 self.assertNotEqual(git_cl.main(['patch', '123456']), 0) | 958 self.assertNotEqual(git_cl.main(['patch', '123456']), 0) |
959 | 959 |
960 if __name__ == '__main__': | 960 if __name__ == '__main__': |
961 git_cl.logging.basicConfig( | 961 git_cl.logging.basicConfig( |
962 level=git_cl.logging.DEBUG if '-v' in sys.argv else git_cl.logging.ERROR) | 962 level=git_cl.logging.DEBUG if '-v' in sys.argv else git_cl.logging.ERROR) |
963 unittest.main() | 963 unittest.main() |
OLD | NEW |