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

Side by Side Diff: tests/gcl_unittest.py

Issue 115283: Fix unit test due to change r15911. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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/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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 # If this test fails, you should add the relevant test. 62 # If this test fails, you should add the relevant test.
63 self.compareMembers(gcl, members) 63 self.compareMembers(gcl, members)
64 64
65 65
66 def testHelp(self): 66 def testHelp(self):
67 old_stdout = sys.stdout 67 old_stdout = sys.stdout
68 try: 68 try:
69 dummy = StringIO.StringIO() 69 dummy = StringIO.StringIO()
70 gcl.sys.stdout = dummy 70 gcl.sys.stdout = dummy
71 gcl.Help() 71 gcl.Help()
72 self.assertEquals(len(dummy.getvalue()), 1718) 72 self.assertEquals(len(dummy.getvalue()), 1813)
73 finally: 73 finally:
74 gcl.sys.stdout = old_stdout 74 gcl.sys.stdout = old_stdout
75 75
76 def testGetRepositoryRoot(self): 76 def testGetRepositoryRoot(self):
77 try: 77 try:
78 def RunShellMock(filename): 78 def RunShellMock(filename):
79 return '<?xml version="1.0"?>\n<info>' 79 return '<?xml version="1.0"?>\n<info>'
80 gcl.RunShell = RunShellMock 80 gcl.RunShell = RunShellMock
81 gcl.GetRepositoryRoot() 81 gcl.GetRepositoryRoot()
82 except Exception,e: 82 except Exception,e:
(...skipping 17 matching lines...) Expand all
100 self.assertEquals(o.name, 'name2') 100 self.assertEquals(o.name, 'name2')
101 self.assertEquals(o.issue, 'issue2') 101 self.assertEquals(o.issue, 'issue2')
102 self.assertEquals(o.description, 'description2') 102 self.assertEquals(o.description, 'description2')
103 self.assertEquals(o.files, files) 103 self.assertEquals(o.files, files)
104 self.assertEquals(o.patch, None) 104 self.assertEquals(o.patch, None)
105 self.assertEquals(o.FileList(), ['foo', 'bar']) 105 self.assertEquals(o.FileList(), ['foo', 'bar'])
106 106
107 107
108 if __name__ == '__main__': 108 if __name__ == '__main__':
109 unittest.main() 109 unittest.main()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698