| 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 GclientUtilsUnittest(SuperMoxTestBase): | 14 class GclientUtilsUnittest(SuperMoxTestBase): |
| 15 """General gclient_utils.py tests.""" | 15 """General gclient_utils.py tests.""" |
| 16 def testMembersChanged(self): | 16 def testMembersChanged(self): |
| 17 members = [ | 17 members = [ |
| 18 'CheckCall', 'CheckCallError', 'Error', 'FileRead', 'FileWrite', | 18 'CheckCall', 'CheckCallError', 'Error', 'FileRead', 'FileWrite', |
| 19 'FindGclientRoot', 'GetNamedNodeText', | 19 'FindFileUpwards', 'FindGclientRoot', 'GetGClientRootAndEntries', |
| 20 'GetNodeNamedAttributeText', 'IsUsingGit', 'PathDifference', | 20 'GetNamedNodeText', 'GetNodeNamedAttributeText', 'IsUsingGit', |
| 21 'ParseXML', 'PrintableObject', 'RemoveDirectory', 'SplitUrlRevision', | 21 'PathDifference', 'ParseXML', 'PrintableObject', 'RemoveDirectory', |
| 22 'SubprocessCall', 'SubprocessCallAndFilter', 'errno', 'logging', 'os', | 22 'SplitUrlRevision', 'SubprocessCall', 'SubprocessCallAndFilter', |
| 23 're', 'stat', 'subprocess', 'sys', 'time', 'xml', | 23 'errno', 'logging', 'os', 're', 'stat', 'subprocess', 'sys', 'time', |
| 24 'xml', |
| 24 ] | 25 ] |
| 25 # If this test fails, you should add the relevant test. | 26 # If this test fails, you should add the relevant test. |
| 26 self.compareMembers(gclient_utils, members) | 27 self.compareMembers(gclient_utils, members) |
| 27 | 28 |
| 28 | 29 |
| 29 class CheckCallTestCase(SuperMoxTestBase): | 30 class CheckCallTestCase(SuperMoxTestBase): |
| 30 def testCheckCallSuccess(self): | 31 def testCheckCallSuccess(self): |
| 31 command = ['boo', 'foo', 'bar'] | 32 command = ['boo', 'foo', 'bar'] |
| 32 process = self.mox.CreateMockAnything() | 33 process = self.mox.CreateMockAnything() |
| 33 process.returncode = 0 | 34 process.returncode = 0 |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 out_url, out_rev = gclient_utils.SplitUrlRevision("%s@%s" % (url, rev)) | 138 out_url, out_rev = gclient_utils.SplitUrlRevision("%s@%s" % (url, rev)) |
| 138 self.assertEquals(out_rev, rev) | 139 self.assertEquals(out_rev, rev) |
| 139 self.assertEquals(out_url, url) | 140 self.assertEquals(out_url, url) |
| 140 | 141 |
| 141 | 142 |
| 142 if __name__ == '__main__': | 143 if __name__ == '__main__': |
| 143 import unittest | 144 import unittest |
| 144 unittest.main() | 145 unittest.main() |
| 145 | 146 |
| 146 # vim: ts=2:sw=2:tw=80:et: | 147 # vim: ts=2:sw=2:tw=80:et: |
| OLD | NEW |