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

Side by Side Diff: tests/gcl_unittest.py

Issue 115616: Add repository root presubmit support. (Closed)
Patch Set: Fix diff to not include the prior patches. Created 11 years, 7 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 | « presubmit_support.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/python 1 #!/usr/bin/python
2 # Copyright (c) 2009 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2009 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 import StringIO 8 import StringIO
9 import os 9 import os
10 import sys 10 import sys
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 # If this test fails, you should add the relevant test. 72 # If this test fails, you should add the relevant test.
73 self.compareMembers(gcl, members) 73 self.compareMembers(gcl, members)
74 74
75 75
76 def testHelp(self): 76 def testHelp(self):
77 old_stdout = sys.stdout 77 old_stdout = sys.stdout
78 try: 78 try:
79 dummy = StringIO.StringIO() 79 dummy = StringIO.StringIO()
80 gcl.sys.stdout = dummy 80 gcl.sys.stdout = dummy
81 gcl.Help() 81 gcl.Help()
82 self.assertEquals(len(dummy.getvalue()), 1815) 82 self.assertEquals(len(dummy.getvalue()), 1832)
83 finally: 83 finally:
84 gcl.sys.stdout = old_stdout 84 gcl.sys.stdout = old_stdout
85 85
86 def testGetRepositoryRootNone(self): 86 def testGetRepositoryRootNone(self):
87 gcl.REPOSITORY_ROOT = None 87 gcl.REPOSITORY_ROOT = None
88 gcl.os.getcwd().AndReturn("/bleh/prout") 88 gcl.os.getcwd().AndReturn("/bleh/prout")
89 result = { 89 result = {
90 "Repository Root": "" 90 "Repository Root": ""
91 } 91 }
92 gcl.gclient.CaptureSVNInfo("/bleh/prout", print_error=False).AndReturn( 92 gcl.gclient.CaptureSVNInfo("/bleh/prout", print_error=False).AndReturn(
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 ['--issue', '1', '--patchset', '2'], 278 ['--issue', '1', '--patchset', '2'],
279 swallow_exception=True) 279 swallow_exception=True)
280 gcl.os.chdir('somewhere') 280 gcl.os.chdir('somewhere')
281 self.mox.ReplayAll() 281 self.mox.ReplayAll()
282 gcl.UploadCL(change_info, args) 282 gcl.UploadCL(change_info, args)
283 self.mox.VerifyAll() 283 self.mox.VerifyAll()
284 284
285 285
286 if __name__ == '__main__': 286 if __name__ == '__main__':
287 unittest.main() 287 unittest.main()
OLDNEW
« no previous file with comments | « presubmit_support.py ('k') | tests/presubmit_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698