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 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 ((['git', 'log', '--pretty=format:%s\n\n%b', | 581 ((['git', 'log', '--pretty=format:%s\n\n%b', |
582 'fake_ancestor_sha..HEAD'],), | 582 'fake_ancestor_sha..HEAD'],), |
583 description), | 583 description), |
584 ((['git', 'commit', '--amend', '-m', description],), | 584 ((['git', 'commit', '--amend', '-m', description],), |
585 ''), | 585 ''), |
586 ((['git', 'log', '--pretty=format:%s\n\n%b', | 586 ((['git', 'log', '--pretty=format:%s\n\n%b', |
587 'fake_ancestor_sha..HEAD'],), | 587 'fake_ancestor_sha..HEAD'],), |
588 description) | 588 description) |
589 ] | 589 ] |
590 calls += [ | 590 calls += [ |
| 591 ((['git', 'rev-list', 'origin/master..'],), ''), |
591 ((['git', 'config', 'rietveld.cc'],), '') | 592 ((['git', 'config', 'rietveld.cc'],), '') |
592 ] | 593 ] |
593 receive_pack = '--receive-pack=git receive-pack ' | 594 receive_pack = '--receive-pack=git receive-pack ' |
594 receive_pack += '--cc=joe@example.com' # from watch list | 595 receive_pack += '--cc=joe@example.com' # from watch list |
595 if reviewers: | 596 if reviewers: |
596 receive_pack += ' ' | 597 receive_pack += ' ' |
597 receive_pack += ' '.join( | 598 receive_pack += ' '.join( |
598 '--reviewer=' + email for email in sorted(reviewers)) | 599 '--reviewer=' + email for email in sorted(reviewers)) |
599 receive_pack += '' | 600 receive_pack += '' |
600 calls += [ | 601 calls += [ |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
744 obj = git_cl.ChangeDescription(orig) | 745 obj = git_cl.ChangeDescription(orig) |
745 obj.update_reviewers(reviewers) | 746 obj.update_reviewers(reviewers) |
746 actual.append(obj.description) | 747 actual.append(obj.description) |
747 self.assertEqual(expected, actual) | 748 self.assertEqual(expected, actual) |
748 | 749 |
749 | 750 |
750 if __name__ == '__main__': | 751 if __name__ == '__main__': |
751 git_cl.logging.basicConfig( | 752 git_cl.logging.basicConfig( |
752 level=git_cl.logging.DEBUG if '-v' in sys.argv else git_cl.logging.ERROR) | 753 level=git_cl.logging.DEBUG if '-v' in sys.argv else git_cl.logging.ERROR) |
753 unittest.main() | 754 unittest.main() |
OLD | NEW |