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

Side by Side Diff: tests/gclient_utils_test.py

Issue 134313007: Depot tools: use the clang-format binaries that are now included (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Fixed gclient_utils_test.py Created 6 years, 11 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 | « gn.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 import os 6 import os
7 import StringIO 7 import StringIO
8 import sys 8 import sys
9 9
10 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) 10 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
(...skipping 13 matching lines...) Expand all
24 self.mox.StubOutWithMock(subprocess2, 'communicate') 24 self.mox.StubOutWithMock(subprocess2, 'communicate')
25 25
26 26
27 class GclientUtilsUnittest(GclientUtilBase): 27 class GclientUtilsUnittest(GclientUtilBase):
28 """General gclient_utils.py tests.""" 28 """General gclient_utils.py tests."""
29 def testMembersChanged(self): 29 def testMembersChanged(self):
30 members = [ 30 members = [
31 'Annotated', 'AutoFlush', 'CheckCallAndFilter', 'CommandToStr', 31 'Annotated', 'AutoFlush', 'CheckCallAndFilter', 'CommandToStr',
32 'CheckCallAndFilterAndHeader', 'Error', 'ExecutionQueue', 'FileRead', 32 'CheckCallAndFilterAndHeader', 'Error', 'ExecutionQueue', 'FileRead',
33 'FileWrite', 'FindFileUpwards', 'FindGclientRoot', 33 'FileWrite', 'FindFileUpwards', 'FindGclientRoot',
34 'GetGClientRootAndEntries', 'GetEditor', 'IsDateRevision', 34 'GetGClientRootAndEntries', 'GetEditor', 'GetExeSuffix',
35 'MakeDateRevision', 'MakeFileAutoFlush', 'MakeFileAnnotated', 35 'GetMacWinOrLinux', 'IsDateRevision', 'MakeDateRevision',
36 'PathDifference', 'ParseCodereviewSettingsContent', 'NumLocalCpus', 36 'MakeFileAutoFlush', 'MakeFileAnnotated', 'PathDifference',
37 'PrintableObject', 'RETRY_INITIAL_SLEEP', 'RETRY_MAX', 'RunEditor', 37 'ParseCodereviewSettingsContent', 'NumLocalCpus', 'PrintableObject',
38 'GCLIENT_CHILDREN', 'GCLIENT_CHILDREN_LOCK', 'GClientChildren', 38 'RETRY_INITIAL_SLEEP', 'RETRY_MAX', 'RunEditor', 'GCLIENT_CHILDREN',
39 'SplitUrlRevision', 'SyntaxErrorToError', 'UpgradeToHttps', 'Wrapper', 39 'GCLIENT_CHILDREN_LOCK', 'GClientChildren', 'SplitUrlRevision',
40 'WorkItem', 'codecs', 'lockedmethod', 'logging', 'os', 'pipes', 'Queue', 40 'SyntaxErrorToError', 'UpgradeToHttps', 'Wrapper', 'WorkItem',
41 're', 'rmtree', 'safe_makedirs', 'safe_rename', 'stat', 'subprocess', 41 'codecs', 'lockedmethod', 'logging', 'os', 'pipes', 'Queue', 're',
42 'rmtree', 'safe_makedirs', 'safe_rename', 'stat', 'subprocess',
42 'subprocess2', 'sys', 'tempfile', 'threading', 'time', 'urlparse', 43 'subprocess2', 'sys', 'tempfile', 'threading', 'time', 'urlparse',
44
43 ] 45 ]
44 # If this test fails, you should add the relevant test. 46 # If this test fails, you should add the relevant test.
45 self.compareMembers(gclient_utils, members) 47 self.compareMembers(gclient_utils, members)
46 48
47 49
48 50
49 class CheckCallAndFilterTestCase(GclientUtilBase): 51 class CheckCallAndFilterTestCase(GclientUtilBase):
50 class ProcessIdMock(object): 52 class ProcessIdMock(object):
51 def __init__(self, test_string): 53 def __init__(self, test_string):
52 self.stdout = StringIO.StringIO(test_string) 54 self.stdout = StringIO.StringIO(test_string)
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 for content, expected in values: 216 for content, expected in values:
215 self.assertEquals( 217 self.assertEquals(
216 expected, gclient_utils.ParseCodereviewSettingsContent(content)) 218 expected, gclient_utils.ParseCodereviewSettingsContent(content))
217 219
218 220
219 if __name__ == '__main__': 221 if __name__ == '__main__':
220 import unittest 222 import unittest
221 unittest.main() 223 unittest.main()
222 224
223 # vim: ts=2:sw=2:tw=80:et: 225 # vim: ts=2:sw=2:tw=80:et:
OLDNEW
« no previous file with comments | « gn.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698