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 """Unit tests for trychange.py.""" | 6 """Unit tests for trychange.py.""" |
7 | 7 |
| 8 # pylint: disable=E1103,W0403 |
| 9 |
8 # Fixes include path. | 10 # Fixes include path. |
9 from super_mox import mox, SuperMoxTestBase | 11 from super_mox import SuperMoxTestBase |
10 | 12 |
11 import trychange | 13 import trychange |
12 | 14 |
13 | 15 |
14 class TryChangeTestsBase(SuperMoxTestBase): | 16 class TryChangeTestsBase(SuperMoxTestBase): |
15 """Setups and tear downs the mocks but doesn't test anything as-is.""" | 17 """Setups and tear downs the mocks but doesn't test anything as-is.""" |
16 def setUp(self): | 18 def setUp(self): |
17 SuperMoxTestBase.setUp(self) | 19 SuperMoxTestBase.setUp(self) |
18 self.mox.StubOutWithMock(trychange.gclient_utils, 'CheckCall') | 20 self.mox.StubOutWithMock(trychange.gclient_utils, 'CheckCall') |
19 self.mox.StubOutWithMock(trychange.scm.GIT, 'Capture') | 21 self.mox.StubOutWithMock(trychange.scm.GIT, 'Capture') |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 self.mox.ReplayAll() | 99 self.mox.ReplayAll() |
98 git = trychange.GIT(self.options, self.fake_root) | 100 git = trychange.GIT(self.options, self.fake_root) |
99 self.assertEqual(git.GetFileNames(), self.expected_files) | 101 self.assertEqual(git.GetFileNames(), self.expected_files) |
100 self.assertEqual(git.checkout_root, self.fake_root) | 102 self.assertEqual(git.checkout_root, self.fake_root) |
101 self.assertEqual(git.GenerateDiff(), 'A diff') | 103 self.assertEqual(git.GenerateDiff(), 'A diff') |
102 | 104 |
103 | 105 |
104 if __name__ == '__main__': | 106 if __name__ == '__main__': |
105 import unittest | 107 import unittest |
106 unittest.main() | 108 unittest.main() |
OLD | NEW |