OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 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 # pylint: disable=E1101,W0403 | 6 # pylint: disable=E1101,W0403 |
7 | 7 |
8 import os | 8 import os |
9 import StringIO | 9 import StringIO |
10 | 10 |
(...skipping 13 matching lines...) Expand all Loading... |
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', | 31 'Annotated', 'AutoFlush', 'CheckCallAndFilter', |
32 'CheckCallAndFilterAndHeader', 'Error', 'ExecutionQueue', 'FileRead', | 32 'CheckCallAndFilterAndHeader', 'Error', 'ExecutionQueue', 'FileRead', |
33 'FileWrite', 'FindFileUpwards', 'FindGclientRoot', | 33 'FileWrite', 'FindFileUpwards', 'FindGclientRoot', |
34 'GetGClientRootAndEntries', 'IsDateRevision', 'MakeDateRevision', | 34 'GetGClientRootAndEntries', 'GetEditor', 'IsDateRevision', |
35 'MakeFileAutoFlush', 'MakeFileAnnotated', 'PathDifference', | 35 'MakeDateRevision', 'MakeFileAutoFlush', 'MakeFileAnnotated', |
36 'PrintableObject', 'RemoveDirectory', 'SplitUrlRevision', | 36 'PathDifference', 'PrintableObject', 'RemoveDirectory', 'RunEditor', |
37 'SyntaxErrorToError', 'Wrapper', 'WorkItem', | 37 'SplitUrlRevision', 'SyntaxErrorToError', 'Wrapper', 'WorkItem', |
38 'errno', 'lockedmethod', 'logging', 'os', 'Queue', 're', 'rmtree', | 38 'errno', 'lockedmethod', 'logging', 'os', 'Queue', 're', 'rmtree', |
39 'safe_makedirs', 'stat', 'subprocess2', 'sys','threading', 'time', | 39 'safe_makedirs', 'stat', 'subprocess2', 'sys', 'tempfile', 'threading', |
| 40 'time', |
40 ] | 41 ] |
41 # If this test fails, you should add the relevant test. | 42 # If this test fails, you should add the relevant test. |
42 self.compareMembers(gclient_utils, members) | 43 self.compareMembers(gclient_utils, members) |
43 | 44 |
44 | 45 |
45 | 46 |
46 class CheckCallAndFilterTestCase(GclientUtilBase): | 47 class CheckCallAndFilterTestCase(GclientUtilBase): |
47 class ProcessIdMock(object): | 48 class ProcessIdMock(object): |
48 def __init__(self, test_string): | 49 def __init__(self, test_string): |
49 self.stdout = StringIO.StringIO(test_string) | 50 self.stdout = StringIO.StringIO(test_string) |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 os.chmod(l3, 0) | 168 os.chmod(l3, 0) |
168 os.chmod(l2, 0) | 169 os.chmod(l2, 0) |
169 os.chmod(l1, 0) | 170 os.chmod(l1, 0) |
170 | 171 |
171 | 172 |
172 if __name__ == '__main__': | 173 if __name__ == '__main__': |
173 import unittest | 174 import unittest |
174 unittest.main() | 175 unittest.main() |
175 | 176 |
176 # vim: ts=2:sw=2:tw=80:et: | 177 # vim: ts=2:sw=2:tw=80:et: |
OLD | NEW |