Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: tests/trychange_unittest.py

Issue 9379005: [depot_tools] Use git fetch to optimize the properly configured that use git-svn (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: regex tweak Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« presubmit_canned_checks.py ('K') | « tests/gclient_scm_test.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 """Unit tests for trychange.py.""" 6 """Unit tests for trychange.py."""
7 7
8 import os 8 import os
9 import sys 9 import sys
10 10
11 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) 11 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
12 12
13 from testing_support.super_mox import SuperMoxTestBase 13 from testing_support.super_mox import SuperMoxTestBase
14 14
15 import subprocess2 15 import subprocess2
16 import trychange 16 import trychange
17 17
18 # pylint: disable=E1103
M-A Ruel 2012/02/11 02:38:08 ?
Dan Beam 2012/02/11 02:42:36 pylint was complaining that it's type checking suc
18 19
19 class TryChangeTestsBase(SuperMoxTestBase): 20 class TryChangeTestsBase(SuperMoxTestBase):
20 """Setups and tear downs the mocks but doesn't test anything as-is.""" 21 """Setups and tear downs the mocks but doesn't test anything as-is."""
21 def setUp(self): 22 def setUp(self):
22 SuperMoxTestBase.setUp(self) 23 SuperMoxTestBase.setUp(self)
23 self.mox.StubOutWithMock(subprocess2, 'communicate') 24 self.mox.StubOutWithMock(subprocess2, 'communicate')
24 self.mox.StubOutWithMock(trychange.scm.GIT, 'Capture') 25 self.mox.StubOutWithMock(trychange.scm.GIT, 'Capture')
25 self.mox.StubOutWithMock(trychange.scm.GIT, 'GenerateDiff') 26 self.mox.StubOutWithMock(trychange.scm.GIT, 'GenerateDiff')
26 self.mox.StubOutWithMock(trychange.scm.GIT, 'GetCheckoutRoot') 27 self.mox.StubOutWithMock(trychange.scm.GIT, 'GetCheckoutRoot')
27 self.mox.StubOutWithMock(trychange.scm.GIT, 'GetEmail') 28 self.mox.StubOutWithMock(trychange.scm.GIT, 'GetEmail')
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 self.mox.ReplayAll() 107 self.mox.ReplayAll()
107 git = trychange.GIT(self.options, self.fake_root, self.options.files) 108 git = trychange.GIT(self.options, self.fake_root, self.options.files)
108 self.assertEqual(git.GetFileNames(), self.expected_files) 109 self.assertEqual(git.GetFileNames(), self.expected_files)
109 self.assertEqual(git.checkout_root, self.fake_root) 110 self.assertEqual(git.checkout_root, self.fake_root)
110 self.assertEqual(git.GenerateDiff(), 'A diff') 111 self.assertEqual(git.GenerateDiff(), 'A diff')
111 112
112 113
113 if __name__ == '__main__': 114 if __name__ == '__main__':
114 import unittest 115 import unittest
115 unittest.main() 116 unittest.main()
OLDNEW
« presubmit_canned_checks.py ('K') | « tests/gclient_scm_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698