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

Unified Diff: tests/gcl_unittest.py

Issue 13800018: Make gcl use git_cl.py code for consistency in the CL description formatting. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@2_refactor
Patch Set: append_line -> append_footer Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gcl.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/gcl_unittest.py
diff --git a/tests/gcl_unittest.py b/tests/gcl_unittest.py
index ddaab3a82b481b5ba51aaaa09c25ff61ee6aa2ff..cbde6a473bbdd28033b58282728d7c3e67da7546 100755
--- a/tests/gcl_unittest.py
+++ b/tests/gcl_unittest.py
@@ -53,7 +53,6 @@ class GclTestsBase(SuperMoxTestBase):
change_info.GetLocalRoot = lambda : 'proout'
change_info.patch = None
change_info.rietveld = 'https://my_server'
- change_info.reviewers = None
change_info._closed = False
change_info._deleted = False
change_info._comments_added = []
@@ -102,13 +101,13 @@ class GclUnittest(GclTestsBase):
'GetCodeReviewSetting', 'GetFilesNotInCL', 'GetInfoDir',
'GetModifiedFiles', 'GetRepositoryRoot', 'ListFiles',
'LoadChangelistInfoForMultiple', 'MISSING_TEST_MSG',
- 'OptionallyDoPresubmitChecks', 'REPOSITORY_ROOT', 'REVIEWERS_REGEX',
+ 'OptionallyDoPresubmitChecks', 'REPOSITORY_ROOT',
'RunShell', 'RunShellWithReturnCode', 'SVN',
'TryChange', 'UnknownFiles', 'Warn',
'attrs', 'breakpad', 'defer_attributes', 'fix_encoding',
- 'gclient_utils', 'json', 'main', 'need_change', 'need_change_and_args',
- 'no_args', 'optparse', 'os', 'presubmit_support', 'random', 're',
- 'rietveld',
+ 'gclient_utils', 'git_cl', 'json', 'main', 'need_change',
+ 'need_change_and_args', 'no_args', 'optparse', 'os',
+ 'presubmit_support', 'random', 're', 'rietveld',
'string', 'subprocess2', 'sys', 'tempfile', 'time',
'upload', 'urllib2',
]
@@ -193,13 +192,15 @@ class ChangeInfoUnittest(GclTestsBase):
self.mox.ReplayAll()
members = [
'AddComment', 'CloseIssue', 'Delete', 'Exists', 'GetFiles',
- 'GetFileNames', 'GetLocalRoot', 'GetIssueDescription', 'Load',
+ 'GetFileNames', 'GetLocalRoot',
+ 'Load',
'MissingTests', 'NeedsUpload', 'PrimeLint', 'RpcServer', 'Save',
'SendToRietveld',
'SEPARATOR',
- 'UpdateRietveldDescription',
- 'description', 'issue', 'name',
- 'needs_upload', 'patch', 'patchset', 'reviewers', 'rietveld',
+ 'UpdateDescriptionFromIssue', 'UpdateRietveldDescription',
+ 'append_footer',
+ 'description', 'force_description', 'get_reviewers', 'issue', 'name',
+ 'needs_upload', 'patch', 'patchset', 'rietveld',
]
# If this test fails, you should add the relevant test.
self.compareMembers(
@@ -322,6 +323,7 @@ class CMDuploadUnittest(GclTestsBase):
gcl.os.getcwd().AndReturn('somewhere')
change_info.GetFiles().AndReturn(change_info.files)
gcl.os.chdir('proout')
+ change_info.get_reviewers().AndReturn('foo@bar.com')
change_info.GetFileNames().AndReturn(files)
gcl.GenerateDiff(files)
gcl.upload.RealMain(['upload.py', '-y', '--server=https://my_server',
@@ -456,13 +458,13 @@ class CMDuploadUnittest(GclTestsBase):
change_info.files = [('A', 'aa'), ('M', 'bb')]
change_info.patch = None
change_info.rietveld = 'https://my_server'
- change_info.reviewers = ['georges@example.com']
files = [item[1] for item in change_info.files]
output = presubmit_support.PresubmitOutput()
gcl.DoPresubmitChecks(change_info, False, True).AndReturn(output)
#gcl.GetCodeReviewSetting('CODE_REVIEW_SERVER').AndReturn('my_server')
gcl.os.getcwd().AndReturn('somewhere')
change_info.GetFiles().AndReturn(change_info.files)
+ change_info.get_reviewers().AndReturn(['georges@example.com'])
change_info.GetFileNames().AndReturn(files)
change_info.GetLocalRoot().AndReturn('proout')
gcl.os.chdir('proout')
@@ -500,6 +502,7 @@ class CMDuploadUnittest(GclTestsBase):
'--reviewers=foo@example.com,bar@example.com',
'--issue=1', '--title= '],
change_info.patch).AndReturn(("1", "2"))
+ change_info.get_reviewers().AndReturn(['foo@example.com,bar@example.com'])
change_info.Save()
change_info.PrimeLint()
gcl.os.chdir('somewhere')
@@ -572,7 +575,8 @@ class CMDCommitUnittest(GclTestsBase):
change_info = self.mockLoad()
self.mockPresubmit(change_info, fail=False)
self.mockCommit(
- change_info, 'deescription\nReview URL: https://my_server/1', '')
+ change_info, 'deescription\n\nReview URL: https://my_server/1', '')
+ change_info.UpdateDescriptionFromIssue()
self.mox.ReplayAll()
retval = gcl.CMDcommit(['naame'])
@@ -587,15 +591,17 @@ class CMDCommitUnittest(GclTestsBase):
change_info = self.mockLoad()
self.mockPresubmit(change_info, fail=False)
self.mockCommit(
- change_info, 'deescription\nReview URL: https://my_server/1',
+ change_info,
+ 'deescription\n\nReview URL: https://my_server/1',
'\nCommitted revision 12345')
-
+ change_info.UpdateDescriptionFromIssue()
+ change_info.append_footer('Committed: http://view/12345')
self.mox.ReplayAll()
retval = gcl.CMDcommit(['naame'])
self.assertEquals(retval, 0)
- self.assertEquals(change_info.description,
- 'deescription\n\nCommitted: http://view/12345')
+ # This is because append_footer is mocked.
+ self.assertEquals(change_info.description, 'deescription')
# pylint: disable=W0212
self.assertTrue(change_info._deleted)
self.assertTrue(change_info._closed)
« no previous file with comments | « gcl.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698