OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2009 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 """Unit tests for gcl.py.""" | 6 """Unit tests for gcl.py.""" |
7 | 7 |
8 # Local imports | 8 # Fixes include path. |
| 9 from super_mox import mox, SuperMoxTestBase |
| 10 |
9 import gcl | 11 import gcl |
10 from super_mox import mox, SuperMoxTestBase | |
11 | 12 |
12 | 13 |
13 class GclTestsBase(SuperMoxTestBase): | 14 class GclTestsBase(SuperMoxTestBase): |
14 """Setups and tear downs the mocks but doesn't test anything as-is.""" | 15 """Setups and tear downs the mocks but doesn't test anything as-is.""" |
15 def setUp(self): | 16 def setUp(self): |
16 SuperMoxTestBase.setUp(self) | 17 SuperMoxTestBase.setUp(self) |
17 self.fake_root_dir = self.RootDir() | 18 self.fake_root_dir = self.RootDir() |
18 self.mox.StubOutWithMock(gcl, 'RunShell') | 19 self.mox.StubOutWithMock(gcl, 'RunShell') |
19 self.mox.StubOutWithMock(gcl.SVN, 'CaptureInfo') | 20 self.mox.StubOutWithMock(gcl.SVN, 'CaptureInfo') |
20 self.mox.StubOutWithMock(gcl.SVN, 'GetCheckoutRoot') | 21 self.mox.StubOutWithMock(gcl.SVN, 'GetCheckoutRoot') |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 self.mox.ReplayAll() | 345 self.mox.ReplayAll() |
345 | 346 |
346 gcl.UploadCL(change_info, args) | 347 gcl.UploadCL(change_info, args) |
347 self.assertEquals(change_info.issue, 1) | 348 self.assertEquals(change_info.issue, 1) |
348 self.assertEquals(change_info.patchset, 2) | 349 self.assertEquals(change_info.patchset, 2) |
349 | 350 |
350 | 351 |
351 if __name__ == '__main__': | 352 if __name__ == '__main__': |
352 import unittest | 353 import unittest |
353 unittest.main() | 354 unittest.main() |
OLD | NEW |