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 sys | 10 import sys |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 'Issue: 12345\n\nReview URL: https://codereview.example.com/12345'],), | 194 'Issue: 12345\n\nReview URL: https://codereview.example.com/12345'],), |
195 ''), | 195 ''), |
196 ((['git', 'svn', 'dcommit', '--no-rebase', '--rmdir'],), (('', None), 0)), | 196 ((['git', 'svn', 'dcommit', '--no-rebase', '--rmdir'],), (('', None), 0)), |
197 ((['git', 'checkout', '-q', 'working'],), ''), | 197 ((['git', 'checkout', '-q', 'working'],), ''), |
198 ((['git', 'branch', '-D', 'git-cl-commit'],), ''), | 198 ((['git', 'branch', '-D', 'git-cl-commit'],), ''), |
199 ] | 199 ] |
200 | 200 |
201 @staticmethod | 201 @staticmethod |
202 def _cmd_line(description, args): | 202 def _cmd_line(description, args): |
203 """Returns the upload command line passed to upload.RealMain().""" | 203 """Returns the upload command line passed to upload.RealMain().""" |
| 204 msg = description.split('\n', 1)[0] |
204 return [ | 205 return [ |
205 'upload', '--assume_yes', '--server', | 206 'upload', '--assume_yes', '--server', |
206 'https://codereview.example.com', | 207 'https://codereview.example.com', |
207 '--message', description | 208 '--message', msg, |
| 209 '--description', description |
208 ] + args + [ | 210 ] + args + [ |
209 '--cc', 'joe@example.com', | 211 '--cc', 'joe@example.com', |
210 'master...' | 212 'master...' |
211 ] | 213 ] |
212 | 214 |
213 def _run_reviewer_test( | 215 def _run_reviewer_test( |
214 self, | 216 self, |
215 upload_args, | 217 upload_args, |
216 expected_description, | 218 expected_description, |
217 returned_description, | 219 returned_description, |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 def test_dcommit_bypass_hooks(self): | 316 def test_dcommit_bypass_hooks(self): |
315 self.calls = ( | 317 self.calls = ( |
316 self._dcommit_calls_1() + | 318 self._dcommit_calls_1() + |
317 self._dcommit_calls_bypassed() + | 319 self._dcommit_calls_bypassed() + |
318 self._dcommit_calls_3()) | 320 self._dcommit_calls_3()) |
319 git_cl.main(['dcommit', '--bypass-hooks']) | 321 git_cl.main(['dcommit', '--bypass-hooks']) |
320 | 322 |
321 | 323 |
322 if __name__ == '__main__': | 324 if __name__ == '__main__': |
323 unittest.main() | 325 unittest.main() |
OLD | NEW |