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