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

Side by Side Diff: tests/trychange_unittest.py

Issue 8508015: Create a new depot_tools_testing_lib to move utility modules there (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Renamed to testing_support Created 9 years, 1 month 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/trial_dir.py ('k') | tests/watchlists_unittest.py » ('j') | 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 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 18
19 class TryChangeTestsBase(SuperMoxTestBase): 19 class TryChangeTestsBase(SuperMoxTestBase):
20 """Setups and tear downs the mocks but doesn't test anything as-is.""" 20 """Setups and tear downs the mocks but doesn't test anything as-is."""
21 def setUp(self): 21 def setUp(self):
22 SuperMoxTestBase.setUp(self) 22 SuperMoxTestBase.setUp(self)
23 self.mox.StubOutWithMock(subprocess2, 'communicate') 23 self.mox.StubOutWithMock(subprocess2, 'communicate')
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 self.mox.ReplayAll() 106 self.mox.ReplayAll()
107 git = trychange.GIT(self.options, self.fake_root, self.options.files) 107 git = trychange.GIT(self.options, self.fake_root, self.options.files)
108 self.assertEqual(git.GetFileNames(), self.expected_files) 108 self.assertEqual(git.GetFileNames(), self.expected_files)
109 self.assertEqual(git.checkout_root, self.fake_root) 109 self.assertEqual(git.checkout_root, self.fake_root)
110 self.assertEqual(git.GenerateDiff(), 'A diff') 110 self.assertEqual(git.GenerateDiff(), 'A diff')
111 111
112 112
113 if __name__ == '__main__': 113 if __name__ == '__main__':
114 import unittest 114 import unittest
115 unittest.main() 115 unittest.main()
OLDNEW
« no previous file with comments | « tests/trial_dir.py ('k') | tests/watchlists_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698