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

Side by Side Diff: tests/gcl_unittest.py

Issue 12300005: Fix parameters for git_cl and gcl (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Fix unittest too Created 7 years, 10 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 gcl.py.""" 6 """Unit tests for gcl.py."""
7 7
8 # pylint: disable=E1103,E1101,E1120 8 # pylint: disable=E1103,E1101,E1120
9 9
10 import os 10 import os
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 change_info.GetFileNames = lambda : [f[1] for f in change_info.files] 52 change_info.GetFileNames = lambda : [f[1] for f in change_info.files]
53 change_info.GetLocalRoot = lambda : 'proout' 53 change_info.GetLocalRoot = lambda : 'proout'
54 change_info.patch = None 54 change_info.patch = None
55 change_info.rietveld = 'https://my_server' 55 change_info.rietveld = 'https://my_server'
56 change_info.reviewers = None 56 change_info.reviewers = None
57 change_info._closed = False 57 change_info._closed = False
58 change_info._deleted = False 58 change_info._deleted = False
59 change_info._comments_added = [] 59 change_info._comments_added = []
60 60
61 class RpcServer(object): 61 class RpcServer(object):
62 def get_issue_properties(self, *_): # pylint: disable=R0201 62 # pylint: disable=R0201,W0613
63 def get_issue_properties(self, issue, messages):
63 return { 'patchsets': [1337] } 64 return { 'patchsets': [1337] }
64 change_info.RpcServer = RpcServer 65 change_info.RpcServer = RpcServer
65 66
66 def AddComment(comment): 67 def AddComment(comment):
67 # pylint: disable=W0212 68 # pylint: disable=W0212
68 change_info._comments_added.append(comment) 69 change_info._comments_added.append(comment)
69 change_info.AddComment = AddComment 70 change_info.AddComment = AddComment
70 71
71 def Delete(): 72 def Delete():
72 change_info._deleted = True 73 change_info._deleted = True
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 self.assertTrue(change_info._deleted) 600 self.assertTrue(change_info._deleted)
600 self.assertTrue(change_info._closed) 601 self.assertTrue(change_info._closed)
601 self.assertEqual( 602 self.assertEqual(
602 change_info._comments_added, 603 change_info._comments_added,
603 ["Committed patchset #1 manually as r12345 (presubmit successful)."]) 604 ["Committed patchset #1 manually as r12345 (presubmit successful)."])
604 605
605 606
606 if __name__ == '__main__': 607 if __name__ == '__main__':
607 import unittest 608 import unittest
608 unittest.main() 609 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