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

Unified Diff: trunk/tools/depot_tools/tests/gcl_unittest.py

Issue 14016004: Revert 193525 (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: 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 | « trunk/tools/depot_tools/gcl.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/tools/depot_tools/tests/gcl_unittest.py
===================================================================
--- trunk/tools/depot_tools/tests/gcl_unittest.py (revision 193554)
+++ trunk/tools/depot_tools/tests/gcl_unittest.py (working copy)
@@ -53,6 +53,7 @@
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 = []
@@ -101,13 +102,13 @@
'GetCodeReviewSetting', 'GetFilesNotInCL', 'GetInfoDir',
'GetModifiedFiles', 'GetRepositoryRoot', 'ListFiles',
'LoadChangelistInfoForMultiple', 'MISSING_TEST_MSG',
- 'OptionallyDoPresubmitChecks', 'REPOSITORY_ROOT',
+ 'OptionallyDoPresubmitChecks', 'REPOSITORY_ROOT', 'REVIEWERS_REGEX',
'RunShell', 'RunShellWithReturnCode', 'SVN',
'TryChange', 'UnknownFiles', 'Warn',
'attrs', 'breakpad', 'defer_attributes', 'fix_encoding',
- 'gclient_utils', 'git_cl', 'json', 'main', 'need_change',
- 'need_change_and_args', 'no_args', 'optparse', 'os',
- 'presubmit_support', 'random', 're', 'rietveld',
+ 'gclient_utils', 'json', 'main', 'need_change', 'need_change_and_args',
+ 'no_args', 'optparse', 'os', 'presubmit_support', 'random', 're',
+ 'rietveld',
'string', 'subprocess2', 'sys', 'tempfile', 'time',
'upload', 'urllib2',
]
@@ -192,15 +193,13 @@
self.mox.ReplayAll()
members = [
'AddComment', 'CloseIssue', 'Delete', 'Exists', 'GetFiles',
- 'GetFileNames', 'GetLocalRoot',
- 'Load',
+ 'GetFileNames', 'GetLocalRoot', 'GetIssueDescription', 'Load',
'MissingTests', 'NeedsUpload', 'PrimeLint', 'RpcServer', 'Save',
'SendToRietveld',
'SEPARATOR',
- 'UpdateDescriptionFromIssue', 'UpdateRietveldDescription',
- 'append_footer',
- 'description', 'force_description', 'get_reviewers', 'issue', 'name',
- 'needs_upload', 'patch', 'patchset', 'rietveld',
+ 'UpdateRietveldDescription',
+ 'description', 'issue', 'name',
+ 'needs_upload', 'patch', 'patchset', 'reviewers', 'rietveld',
]
# If this test fails, you should add the relevant test.
self.compareMembers(
@@ -323,7 +322,6 @@
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',
@@ -458,13 +456,13 @@
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')
@@ -502,7 +500,6 @@
'--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')
@@ -575,8 +572,7 @@
change_info = self.mockLoad()
self.mockPresubmit(change_info, fail=False)
self.mockCommit(
- change_info, 'deescription\n\nReview URL: https://my_server/1', '')
- change_info.UpdateDescriptionFromIssue()
+ change_info, 'deescription\nReview URL: https://my_server/1', '')
self.mox.ReplayAll()
retval = gcl.CMDcommit(['naame'])
@@ -591,17 +587,15 @@
change_info = self.mockLoad()
self.mockPresubmit(change_info, fail=False)
self.mockCommit(
- change_info,
- 'deescription\n\nReview URL: https://my_server/1',
+ change_info, 'deescription\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)
- # This is because append_footer is mocked.
- self.assertEquals(change_info.description, 'deescription')
+ self.assertEquals(change_info.description,
+ 'deescription\n\nCommitted: http://view/12345')
# pylint: disable=W0212
self.assertTrue(change_info._deleted)
self.assertTrue(change_info._closed)
« no previous file with comments | « trunk/tools/depot_tools/gcl.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698