Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(239)

Side by Side Diff: tests/git_cl_test.py

Issue 16152005: Change to 72 column reference in git cl upload message (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « git_cl.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 find_copies = None 379 find_copies = None
380 380
381 private = '--private' in upload_args 381 private = '--private' in upload_args
382 382
383 self.calls = self._upload_calls(similarity, find_copies, private) 383 self.calls = self._upload_calls(similarity, find_copies, private)
384 def RunEditor(desc, _, **kwargs): 384 def RunEditor(desc, _, **kwargs):
385 self.assertEquals( 385 self.assertEquals(
386 '# Enter a description of the change.\n' 386 '# Enter a description of the change.\n'
387 '# This will be displayed on the codereview site.\n' 387 '# This will be displayed on the codereview site.\n'
388 '# The first line will also be used as the subject of the review.\n' 388 '# The first line will also be used as the subject of the review.\n'
389 '#----------------------This line is 76 characters long' 389 '#--------------------This line is 72 characters long'
390 '----------------------\n' + 390 '--------------------\n' +
391 expected_description, 391 expected_description,
392 desc) 392 desc)
393 return returned_description 393 return returned_description
394 self.mock(git_cl.gclient_utils, 'RunEditor', RunEditor) 394 self.mock(git_cl.gclient_utils, 'RunEditor', RunEditor)
395 def check_upload(args): 395 def check_upload(args):
396 cmd_line = self._cmd_line(final_description, reviewers, similarity, 396 cmd_line = self._cmd_line(final_description, reviewers, similarity,
397 find_copies, private) 397 find_copies, private)
398 self.assertEquals(cmd_line, args) 398 self.assertEquals(cmd_line, args)
399 return 1, 2 399 return 1, 2
400 self.mock(git_cl.upload, 'RealMain', check_upload) 400 self.mock(git_cl.upload, 'RealMain', check_upload)
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
711 obj = git_cl.ChangeDescription(orig) 711 obj = git_cl.ChangeDescription(orig)
712 obj.update_reviewers(reviewers) 712 obj.update_reviewers(reviewers)
713 actual.append(obj.description) 713 actual.append(obj.description)
714 self.assertEqual(expected, actual) 714 self.assertEqual(expected, actual)
715 715
716 716
717 if __name__ == '__main__': 717 if __name__ == '__main__':
718 git_cl.logging.basicConfig( 718 git_cl.logging.basicConfig(
719 level=git_cl.logging.DEBUG if '-v' in sys.argv else git_cl.logging.ERROR) 719 level=git_cl.logging.DEBUG if '-v' in sys.argv else git_cl.logging.ERROR)
720 unittest.main() 720 unittest.main()
OLDNEW
« no previous file with comments | « git_cl.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698