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

Side by Side Diff: tests/gclient_utils_test.py

Issue 4465001: Reduce the chances for gclient to throw an exception in subprocess module. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: fix license and unit test Created 10 years, 1 month 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 | « gclient_utils.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/python 1 #!/usr/bin/python
2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2010 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 import StringIO 6 import StringIO
7 7
8 # Fixes include path. 8 # Fixes include path.
9 from super_mox import SuperMoxTestBase 9 from super_mox import SuperMoxTestBase
10 10
(...skipping 12 matching lines...) Expand all
23 def testMembersChanged(self): 23 def testMembersChanged(self):
24 members = [ 24 members = [
25 'CheckCall', 'CheckCallError', 'CheckCallAndFilter', 25 'CheckCall', 'CheckCallError', 'CheckCallAndFilter',
26 'CheckCallAndFilterAndHeader', 'Error', 'ExecutionQueue', 'FileRead', 26 'CheckCallAndFilterAndHeader', 'Error', 'ExecutionQueue', 'FileRead',
27 'FileWrite', 'FindFileUpwards', 'FindGclientRoot', 27 'FileWrite', 'FindFileUpwards', 'FindGclientRoot',
28 'GetGClientRootAndEntries', 'GetNamedNodeText', 'MakeFileAutoFlush', 28 'GetGClientRootAndEntries', 'GetNamedNodeText', 'MakeFileAutoFlush',
29 'GetNodeNamedAttributeText', 'MakeFileAnnotated', 'PathDifference', 29 'GetNodeNamedAttributeText', 'MakeFileAnnotated', 'PathDifference',
30 'ParseXML', 'Popen', 30 'ParseXML', 'Popen',
31 'PrintableObject', 'RemoveDirectory', 'SoftClone', 'SplitUrlRevision', 31 'PrintableObject', 'RemoveDirectory', 'SoftClone', 'SplitUrlRevision',
32 'SyntaxErrorToError', 'WorkItem', 32 'SyntaxErrorToError', 'WorkItem',
33 'errno', 'logging', 'os', 'Queue', 're', 'stat', 'subprocess', 33 'errno', 'hack_subprocess', 'logging', 'os', 'Queue', 're', 'stat',
34 'sys','threading', 'time', 'xml', 34 'subprocess', 'sys','threading', 'time', 'xml',
35 ] 35 ]
36 # If this test fails, you should add the relevant test. 36 # If this test fails, you should add the relevant test.
37 self.compareMembers(gclient_utils, members) 37 self.compareMembers(gclient_utils, members)
38 38
39 39
40 class CheckCallTestCase(GclientUtilBase): 40 class CheckCallTestCase(GclientUtilBase):
41 def testCheckCallSuccess(self): 41 def testCheckCallSuccess(self):
42 args = ['boo', 'foo', 'bar'] 42 args = ['boo', 'foo', 'bar']
43 process = self.mox.CreateMockAnything() 43 process = self.mox.CreateMockAnything()
44 process.returncode = 0 44 process.returncode = 0
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 out_url, out_rev = gclient_utils.SplitUrlRevision("%s@%s" % (url, rev)) 176 out_url, out_rev = gclient_utils.SplitUrlRevision("%s@%s" % (url, rev))
177 self.assertEquals(out_rev, rev) 177 self.assertEquals(out_rev, rev)
178 self.assertEquals(out_url, url) 178 self.assertEquals(out_url, url)
179 179
180 180
181 if __name__ == '__main__': 181 if __name__ == '__main__':
182 import unittest 182 import unittest
183 unittest.main() 183 unittest.main()
184 184
185 # vim: ts=2:sw=2:tw=80:et: 185 # vim: ts=2:sw=2:tw=80:et:
OLDNEW
« no previous file with comments | « gclient_utils.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698