OLD | NEW |
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 11 matching lines...) Expand all Loading... |
22 gclient_utils.sys.stdout.flush = lambda: None | 22 gclient_utils.sys.stdout.flush = lambda: None |
23 self.mox.StubOutWithMock(subprocess2, 'Popen') | 23 self.mox.StubOutWithMock(subprocess2, 'Popen') |
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', | 32 'CheckCallAndFilterAndHeader', 'Error', 'ExecutionQueue', 'FileRead', |
33 'enable_deletion_of_conflicting_checkouts', # TODO(borenet): Remove! | |
34 'Error', 'ExecutionQueue', 'FileRead', | |
35 'FileWrite', 'FindFileUpwards', 'FindGclientRoot', | 33 'FileWrite', 'FindFileUpwards', 'FindGclientRoot', |
36 'GetGClientRootAndEntries', 'GetEditor', 'GetExeSuffix', | 34 'GetGClientRootAndEntries', 'GetEditor', 'GetExeSuffix', |
37 'GetMacWinOrLinux', 'GitFilter', 'IsDateRevision', 'MakeDateRevision', | 35 'GetMacWinOrLinux', 'GitFilter', 'IsDateRevision', 'MakeDateRevision', |
38 'MakeFileAutoFlush', 'MakeFileAnnotated', 'PathDifference', | 36 'MakeFileAutoFlush', 'MakeFileAnnotated', 'PathDifference', |
39 'ParseCodereviewSettingsContent', 'NumLocalCpus', 'PrintableObject', | 37 'ParseCodereviewSettingsContent', 'NumLocalCpus', 'PrintableObject', |
40 'RETRY_INITIAL_SLEEP', 'RETRY_MAX', 'RunEditor', 'GCLIENT_CHILDREN', | 38 'RETRY_INITIAL_SLEEP', 'RETRY_MAX', 'RunEditor', 'GCLIENT_CHILDREN', |
41 'GCLIENT_CHILDREN_LOCK', 'GClientChildren', 'SplitUrlRevision', | 39 'GCLIENT_CHILDREN_LOCK', 'GClientChildren', 'SplitUrlRevision', |
42 'SyntaxErrorToError', 'UpgradeToHttps', 'Wrapper', 'WorkItem', | 40 'SyntaxErrorToError', 'UpgradeToHttps', 'Wrapper', 'WorkItem', |
43 'codecs', 'lockedmethod', 'logging', 'os', 'pipes', 'Queue', 're', | 41 'codecs', 'lockedmethod', 'logging', 'os', 'pipes', 'Queue', 're', |
44 'rmtree', 'safe_makedirs', 'safe_rename', | 42 'rmtree', 'safe_makedirs', 'safe_rename', 'stat', 'subprocess', |
45 'socket', # TODO(borenet): Remove! | |
46 'stat', 'subprocess', | |
47 'subprocess2', 'sys', 'tempfile', 'threading', 'time', 'urlparse', | 43 'subprocess2', 'sys', 'tempfile', 'threading', 'time', 'urlparse', |
48 | 44 |
49 ] | 45 ] |
50 # If this test fails, you should add the relevant test. | 46 # If this test fails, you should add the relevant test. |
51 self.compareMembers(gclient_utils, members) | 47 self.compareMembers(gclient_utils, members) |
52 | 48 |
53 | 49 |
54 | 50 |
55 class CheckCallAndFilterTestCase(GclientUtilBase): | 51 class CheckCallAndFilterTestCase(GclientUtilBase): |
56 class ProcessIdMock(object): | 52 class ProcessIdMock(object): |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 for content, expected in values: | 216 for content, expected in values: |
221 self.assertEquals( | 217 self.assertEquals( |
222 expected, gclient_utils.ParseCodereviewSettingsContent(content)) | 218 expected, gclient_utils.ParseCodereviewSettingsContent(content)) |
223 | 219 |
224 | 220 |
225 if __name__ == '__main__': | 221 if __name__ == '__main__': |
226 import unittest | 222 import unittest |
227 unittest.main() | 223 unittest.main() |
228 | 224 |
229 # vim: ts=2:sw=2:tw=80:et: | 225 # vim: ts=2:sw=2:tw=80:et: |
OLD | NEW |