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

Side by Side Diff: tests/gcl_unittest.py

Issue 6825008: First stab at using Rietveld wrapper object in both gcl.py and git-cl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: small fix Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « rietveld.py ('k') | tests/presubmit_unittest.py » ('j') | 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) 2011 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2011 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 gcl.py.""" 6 """Unit tests for gcl.py."""
7 7
8 # pylint is too confused. 8 # pylint is too confused.
9 # pylint: disable=E1101,E1103,E1120,W0212,W0403 9 # pylint: disable=E1101,E1103,E1120,W0212,W0403
10 10
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 'ErrorExit', 'FILES_CACHE', 'FilterFlag', 'GenUsage', 84 'ErrorExit', 'FILES_CACHE', 'FilterFlag', 'GenUsage',
85 'GenerateChangeName', 'GenerateDiff', 'GetCLs', 'GetCacheDir', 85 'GenerateChangeName', 'GenerateDiff', 'GetCLs', 'GetCacheDir',
86 'GetCachedFile', 'GetChangelistInfoFile', 'GetChangesDir', 86 'GetCachedFile', 'GetChangelistInfoFile', 'GetChangesDir',
87 'GetCodeReviewSetting', 'GetEditor', 'GetFilesNotInCL', 'GetInfoDir', 87 'GetCodeReviewSetting', 'GetEditor', 'GetFilesNotInCL', 'GetInfoDir',
88 'GetModifiedFiles', 'GetRepositoryRoot', 'ListFiles', 88 'GetModifiedFiles', 'GetRepositoryRoot', 'ListFiles',
89 'LoadChangelistInfoForMultiple', 'MISSING_TEST_MSG', 89 'LoadChangelistInfoForMultiple', 'MISSING_TEST_MSG',
90 'OptionallyDoPresubmitChecks', 'REPOSITORY_ROOT', 'REVIEWERS_REGEX', 90 'OptionallyDoPresubmitChecks', 'REPOSITORY_ROOT', 'REVIEWERS_REGEX',
91 'RunShell', 'RunShellWithReturnCode', 'SVN', 91 'RunShell', 'RunShellWithReturnCode', 'SVN',
92 'TryChange', 'UnknownFiles', 'Warn', 92 'TryChange', 'UnknownFiles', 'Warn',
93 'attrs', 'breakpad', 'defer_attributes', 'fix_encoding', 93 'attrs', 'breakpad', 'defer_attributes', 'fix_encoding',
94 'gclient_utils', 'getpass', 94 'gclient_utils', 'json', 'main', 'need_change', 'need_change_and_args',
95 'json', 'main', 'need_change', 'need_change_and_args', 'no_args', 95 'no_args', 'optparse', 'os', 'presubmit_support', 'random', 're',
96 'optparse', 'os', 'presubmit_support', 'random', 're', 96 'rietveld',
97 'string', 'subprocess', 'subprocess2', 'sys', 'tempfile', 'time', 97 'string', 'subprocess', 'subprocess2', 'sys', 'tempfile', 'time',
98 'upload', 'urllib2', 98 'upload', 'urllib2',
99 ] 99 ]
100 # If this test fails, you should add the relevant test. 100 # If this test fails, you should add the relevant test.
101 self.compareMembers(gcl, members) 101 self.compareMembers(gcl, members)
102 102
103 def testIsSVNMoved(self): 103 def testIsSVNMoved(self):
104 # TODO(maruel): TEST ME 104 # TODO(maruel): TEST ME
105 pass 105 pass
106 106
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 def setUp(self): 172 def setUp(self):
173 GclTestsBase.setUp(self) 173 GclTestsBase.setUp(self)
174 self.mox.StubOutWithMock(gcl, 'GetChangelistInfoFile') 174 self.mox.StubOutWithMock(gcl, 'GetChangelistInfoFile')
175 self.mox.StubOutWithMock(gcl, 'GetRepositoryRoot') 175 self.mox.StubOutWithMock(gcl, 'GetRepositoryRoot')
176 176
177 def testChangeInfoMembers(self): 177 def testChangeInfoMembers(self):
178 self.mox.ReplayAll() 178 self.mox.ReplayAll()
179 members = [ 179 members = [
180 'CloseIssue', 'Delete', 'Exists', 'GetFiles', 'GetFileNames', 180 'CloseIssue', 'Delete', 'Exists', 'GetFiles', 'GetFileNames',
181 'GetLocalRoot', 'GetIssueDescription', 'Load', 'MissingTests', 181 'GetLocalRoot', 'GetIssueDescription', 'Load', 'MissingTests',
182 'NeedsUpload', 'PrimeLint', 'Save', 'SendToRietveld', 182 'NeedsUpload', 'PrimeLint', 'RpcServer', 'Save', 'SendToRietveld',
183 'UpdateRietveldDescription', 183 'UpdateRietveldDescription',
184 'description', 'issue', 'name', 184 'description', 'issue', 'name',
185 'needs_upload', 'patch', 'patchset', 'reviewers', 'rietveld', 185 'needs_upload', 'patch', 'patchset', 'reviewers', 'rietveld',
186 'subject', 186 'subject',
187 ] 187 ]
188 # If this test fails, you should add the relevant test. 188 # If this test fails, you should add the relevant test.
189 self.compareMembers( 189 self.compareMembers(
190 gcl.ChangeInfo('', 0, 0, '', None, self.fake_root_dir, 'foo'), 190 gcl.ChangeInfo('', 0, 0, '', None, self.fake_root_dir, 'foo'),
191 members) 191 members)
192 192
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 self.assertEquals(retval, 0) 561 self.assertEquals(retval, 0)
562 self.assertEquals(change_info.description, 562 self.assertEquals(change_info.description,
563 'deescription\n\nCommitted: http://view/12345') 563 'deescription\n\nCommitted: http://view/12345')
564 self.assertTrue(change_info._deleted) 564 self.assertTrue(change_info._deleted)
565 self.assertTrue(change_info._closed) 565 self.assertTrue(change_info._closed)
566 566
567 567
568 if __name__ == '__main__': 568 if __name__ == '__main__':
569 import unittest 569 import unittest
570 unittest.main() 570 unittest.main()
OLDNEW
« no previous file with comments | « rietveld.py ('k') | tests/presubmit_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698