@ -694,10 +694,6 @@ class TestGitCl(unittest.TestCase):
calls = [ ]
if squash_mode in ( ' override_squash ' , ' override_nosquash ' ) :
self . mockGit . config [ ' gerrit.override-squash-uploads ' ] = (
' true ' if squash_mode == ' override_squash ' else ' false ' )
if not git_footers . get_footer_change_id ( description ) and not squash :
calls + = [
( ( ' DownloadGerritHook ' , False ) , ' ' ) ,
@ -1108,52 +1104,38 @@ class TestGitCl(unittest.TestCase):
post_amend_description = ' desc ✔ \n \n BUG= \n \n Change-Id: Ixxx ' ,
change_id = ' Ixxx ' )
def test_gerrit_upload_without_change_id_override_nosquash ( self ) :
self . _run_gerrit_upload_test (
[ ] ,
' desc ✔ \n \n BUG= \n ' ,
[ ] ,
squash = False ,
squash_mode = ' override_nosquash ' ,
post_amend_description = ' desc ✔ \n \n BUG= \n \n Change-Id: Ixxx ' ,
change_id = ' Ixxx ' )
def test_gerrit_no_reviewer ( self ) :
self . _run_gerrit_upload_test (
[ ] ,
[ ' --no-squash ' ] ,
' desc ✔ \n \n BUG= \n \n Change-Id: I123456789 \n ' ,
[ ] ,
squash = False ,
squash_mode = ' override_nosquash ' ,
change_id = ' I123456789 ' )
def test_gerrit_no_reviewer_non_chromium_host ( self ) :
# TODO(crbug/877717): remove this test case.
self . _run_gerrit_upload_test (
[ ] ,
[ ' --no-squash ' ] ,
' desc ✔ \n \n BUG= \n \n Change-Id: I123456789 \n ' ,
[ ] ,
squash = False ,
squash_mode = ' override_nosquash ' ,
short_hostname = ' other ' ,
change_id = ' I123456789 ' )
def test_gerrit_patchset_title_special_chars_nosquash ( self ) :
self . _run_gerrit_upload_test (
[ ' - f' , ' -t ' , ' We \' ll escape ^_ ^ special chars...@ {u} ' ] ,
[ ' - -no-squash' , ' - f' , ' -t ' , ' We \' ll escape ^_ ^ special chars...@ {u} ' ] ,
' desc ✔ \n \n BUG= \n \n Change-Id: I123456789 ' ,
squash = False ,
squash_mode = ' override_nosquash ' ,
change_id = ' I123456789 ' ,
title = ' We \' ll escape ^_ ^ special chars...@ {u} ' )
def test_gerrit_reviewers_cmd_line ( self ) :
self . _run_gerrit_upload_test (
[ ' - r' , ' foo@example.com ' , ' --send-mail ' ] ,
[ ' - -no-squash' , ' - r' , ' foo@example.com ' , ' --send-mail ' ] ,
' desc ✔ \n \n BUG= \n \n Change-Id: I123456789 ' ,
reviewers = [ ' foo@example.com ' ] ,
squash = False ,
squash_mode = ' override_nosquash ' ,
notify = True ,
change_id = ' I123456789 ' ,
final_description = (