| 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 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 ((['git', 'config', 'rietveld.tree-status-url'],), ''), | 304 ((['git', 'config', 'rietveld.tree-status-url'],), ''), |
| 305 ] | 305 ] |
| 306 | 306 |
| 307 @classmethod | 307 @classmethod |
| 308 def _dcommit_calls_bypassed(cls): | 308 def _dcommit_calls_bypassed(cls): |
| 309 return [ | 309 return [ |
| 310 ((['git', | 310 ((['git', |
| 311 'config', 'branch.working.rietveldissue'],), '12345'), | 311 'config', 'branch.working.rietveldissue'],), '12345'), |
| 312 ((['git', 'config', 'branch.working.rietveldserver'],), | 312 ((['git', 'config', 'branch.working.rietveldserver'],), |
| 313 'codereview.example.com'), | 313 'codereview.example.com'), |
| 314 ((['git', 'config', 'rietveld.tree-status-url'],), ''), |
| 314 (('GitClHooksBypassedCommit', | 315 (('GitClHooksBypassedCommit', |
| 315 'Issue https://codereview.example.com/12345 bypassed hook when ' | 316 'Issue https://codereview.example.com/12345 bypassed hook when ' |
| 316 'committing'), None), | 317 'committing (tree status was "unset")'), None), |
| 317 ] | 318 ] |
| 318 | 319 |
| 319 @classmethod | 320 @classmethod |
| 320 def _dcommit_calls_3(cls): | 321 def _dcommit_calls_3(cls): |
| 321 return [ | 322 return [ |
| 322 ((['git', | 323 ((['git', |
| 323 'diff', '--no-ext-diff', '--stat', '--find-copies-harder', | 324 'diff', '--no-ext-diff', '--stat', '--find-copies-harder', |
| 324 '-l100000', '-C50', 'fake_ancestor_sha', | 325 '-l100000', '-C50', 'fake_ancestor_sha', |
| 325 'refs/heads/working'],), | 326 'refs/heads/working'],), |
| 326 (' PRESUBMIT.py | 2 +-\n' | 327 (' PRESUBMIT.py | 2 +-\n' |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 obj = git_cl.ChangeDescription(orig) | 728 obj = git_cl.ChangeDescription(orig) |
| 728 obj.update_reviewers(reviewers) | 729 obj.update_reviewers(reviewers) |
| 729 actual.append(obj.description) | 730 actual.append(obj.description) |
| 730 self.assertEqual(expected, actual) | 731 self.assertEqual(expected, actual) |
| 731 | 732 |
| 732 | 733 |
| 733 if __name__ == '__main__': | 734 if __name__ == '__main__': |
| 734 git_cl.logging.basicConfig( | 735 git_cl.logging.basicConfig( |
| 735 level=git_cl.logging.DEBUG if '-v' in sys.argv else git_cl.logging.ERROR) | 736 level=git_cl.logging.DEBUG if '-v' in sys.argv else git_cl.logging.ERROR) |
| 736 unittest.main() | 737 unittest.main() |
| OLD | NEW |