| OLD | NEW |
| 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 |
| 11 import gclient_utils | 11 import gclient_utils |
| 12 | 12 |
| 13 | 13 |
| 14 class GclientUtilBase(SuperMoxTestBase): | 14 class GclientUtilBase(SuperMoxTestBase): |
| 15 def setUp(self): | 15 def setUp(self): |
| 16 super(GclientUtilBase, self).setUp() | 16 super(GclientUtilBase, self).setUp() |
| 17 gclient_utils.sys.stdout.flush = lambda: None | 17 gclient_utils.sys.stdout.flush = lambda: None |
| 18 | 18 |
| 19 | 19 |
| 20 class GclientUtilsUnittest(GclientUtilBase): | 20 class GclientUtilsUnittest(GclientUtilBase): |
| 21 """General gclient_utils.py tests.""" | 21 """General gclient_utils.py tests.""" |
| 22 def testMembersChanged(self): | 22 def testMembersChanged(self): |
| 23 members = [ | 23 members = [ |
| 24 'CheckCall', 'CheckCallError', 'Error', 'ExecutionQueue', 'FileRead', | 24 'CheckCall', 'CheckCallError', 'Error', 'ExecutionQueue', 'FileRead', |
| 25 'FileWrite', 'FindFileUpwards', 'FindGclientRoot', | 25 'FileWrite', 'FindFileUpwards', 'FindGclientRoot', |
| 26 'GetGClientRootAndEntries', 'GetNamedNodeText', | 26 'GetGClientRootAndEntries', 'GetNamedNodeText', |
| 27 'GetNodeNamedAttributeText', 'PathDifference', 'ParseXML', | 27 'GetNodeNamedAttributeText', 'PathDifference', 'ParseXML', 'Popen', |
| 28 'PrintableObject', 'RemoveDirectory', 'SplitUrlRevision', | 28 'PrintableObject', 'RemoveDirectory', 'SplitUrlRevision', |
| 29 'SubprocessCall', 'SubprocessCallAndFilter', 'SyntaxErrorToError', | 29 'SubprocessCall', 'SubprocessCallAndFilter', 'SyntaxErrorToError', |
| 30 'WorkItem', | 30 'WorkItem', |
| 31 'errno', 'logging', 'os', 're', 'stat', 'subprocess', 'sys', | 31 'errno', 'logging', 'os', 're', 'stat', 'subprocess', 'sys', |
| 32 'threading', 'time', 'xml', | 32 'threading', 'time', 'xml', |
| 33 ] | 33 ] |
| 34 # If this test fails, you should add the relevant test. | 34 # If this test fails, you should add the relevant test. |
| 35 self.compareMembers(gclient_utils, members) | 35 self.compareMembers(gclient_utils, members) |
| 36 | 36 |
| 37 | 37 |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 out_url, out_rev = gclient_utils.SplitUrlRevision("%s@%s" % (url, rev)) | 155 out_url, out_rev = gclient_utils.SplitUrlRevision("%s@%s" % (url, rev)) |
| 156 self.assertEquals(out_rev, rev) | 156 self.assertEquals(out_rev, rev) |
| 157 self.assertEquals(out_url, url) | 157 self.assertEquals(out_url, url) |
| 158 | 158 |
| 159 | 159 |
| 160 if __name__ == '__main__': | 160 if __name__ == '__main__': |
| 161 import unittest | 161 import unittest |
| 162 unittest.main() | 162 unittest.main() |
| 163 | 163 |
| 164 # vim: ts=2:sw=2:tw=80:et: | 164 # vim: ts=2:sw=2:tw=80:et: |
| OLD | NEW |