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

Side by Side Diff: tests/trychange_unittest.py

Issue 7906009: Fix a typo that resulted in no tests to be run in depot_tools. :( (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: More Created 9 years, 3 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
« no previous file with comments | « tests/super_mox.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 # pylint: disable=E1103,W0403 8 # pylint: disable=E1103,W0403
9 9
10 # Fixes include path. 10 # Fixes include path.
11 from super_mox import SuperMoxTestBase 11 from super_mox import SuperMoxTestBase
12 12
13 import subprocess2
13 import trychange 14 import trychange
14 15
15 16
16 class TryChangeTestsBase(SuperMoxTestBase): 17 class TryChangeTestsBase(SuperMoxTestBase):
17 """Setups and tear downs the mocks but doesn't test anything as-is.""" 18 """Setups and tear downs the mocks but doesn't test anything as-is."""
18 def setUp(self): 19 def setUp(self):
19 SuperMoxTestBase.setUp(self) 20 SuperMoxTestBase.setUp(self)
20 self.mox.StubOutWithMock(trychange.gclient_utils, 'CheckCall') 21 self.mox.StubOutWithMock(subprocess2, 'communicate')
21 self.mox.StubOutWithMock(trychange.scm.GIT, 'Capture') 22 self.mox.StubOutWithMock(trychange.scm.GIT, 'Capture')
22 self.mox.StubOutWithMock(trychange.scm.GIT, 'GenerateDiff') 23 self.mox.StubOutWithMock(trychange.scm.GIT, 'GenerateDiff')
23 self.mox.StubOutWithMock(trychange.scm.GIT, 'GetCheckoutRoot') 24 self.mox.StubOutWithMock(trychange.scm.GIT, 'GetCheckoutRoot')
24 self.mox.StubOutWithMock(trychange.scm.GIT, 'GetEmail') 25 self.mox.StubOutWithMock(trychange.scm.GIT, 'GetEmail')
25 self.mox.StubOutWithMock(trychange.scm.GIT, 'GetPatchName') 26 self.mox.StubOutWithMock(trychange.scm.GIT, 'GetPatchName')
26 self.mox.StubOutWithMock(trychange.scm.GIT, 'GetUpstreamBranch') 27 self.mox.StubOutWithMock(trychange.scm.GIT, 'GetUpstreamBranch')
27 self.mox.StubOutWithMock(trychange.scm.SVN, 'DiffItem') 28 self.mox.StubOutWithMock(trychange.scm.SVN, 'DiffItem')
28 self.mox.StubOutWithMock(trychange.scm.SVN, 'GenerateDiff') 29 self.mox.StubOutWithMock(trychange.scm.SVN, 'GenerateDiff')
29 self.mox.StubOutWithMock(trychange.scm.SVN, 'GetCheckoutRoot') 30 self.mox.StubOutWithMock(trychange.scm.SVN, 'GetCheckoutRoot')
30 self.mox.StubOutWithMock(trychange.scm.SVN, 'GetEmail') 31 self.mox.StubOutWithMock(trychange.scm.SVN, 'GetEmail')
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 self.mox.ReplayAll() 101 self.mox.ReplayAll()
101 git = trychange.GIT(self.options, self.fake_root) 102 git = trychange.GIT(self.options, self.fake_root)
102 self.assertEqual(git.GetFileNames(), self.expected_files) 103 self.assertEqual(git.GetFileNames(), self.expected_files)
103 self.assertEqual(git.checkout_root, self.fake_root) 104 self.assertEqual(git.checkout_root, self.fake_root)
104 self.assertEqual(git.GenerateDiff(), 'A diff') 105 self.assertEqual(git.GenerateDiff(), 'A diff')
105 106
106 107
107 if __name__ == '__main__': 108 if __name__ == '__main__':
108 import unittest 109 import unittest
109 unittest.main() 110 unittest.main()
OLDNEW
« no previous file with comments | « tests/super_mox.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698