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

Side by Side Diff: tests/trychange_unittest.py

Issue 10750007: [depot_tools] Allow gclient runhooks to work offline w/safesync_url. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: pylint + removing revinfo Created 8 years, 5 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 | « gclient.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) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 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 import unittest 10 import unittest
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 """trychange.SVN tests.""" 101 """trychange.SVN tests."""
102 def testMembersChanged(self): 102 def testMembersChanged(self):
103 members = [ 103 members = [
104 'AutomagicalSettings', 'CaptureStatus', 'GetCodeReviewSetting', 104 'AutomagicalSettings', 'CaptureStatus', 'GetCodeReviewSetting',
105 'ReadRootFile', 'GenerateDiff', 'GetFileNames', 'files', 'file_tuples', 105 'ReadRootFile', 'GenerateDiff', 'GetFileNames', 'files', 'file_tuples',
106 ] 106 ]
107 # If this test fails, you should add the relevant test. 107 # If this test fails, you should add the relevant test.
108 self.compareMembers(trychange.SVN, members) 108 self.compareMembers(trychange.SVN, members)
109 109
110 def testBasic(self): 110 def testBasic(self):
111 # pylint: disable=E1103
111 trychange.os.path.abspath(self.fake_root).AndReturn(self.fake_root) 112 trychange.os.path.abspath(self.fake_root).AndReturn(self.fake_root)
112 trychange.scm.SVN.GetCheckoutRoot(self.fake_root).AndReturn(self.fake_root) 113 trychange.scm.SVN.GetCheckoutRoot(self.fake_root).AndReturn(self.fake_root)
113 trychange.scm.SVN.GenerateDiff(['foo.txt', 'bar.txt'], 114 trychange.scm.SVN.GenerateDiff(['foo.txt', 'bar.txt'],
114 self.fake_root, 115 self.fake_root,
115 full_move=True, 116 full_move=True,
116 revision=None).AndReturn('A diff') 117 revision=None).AndReturn('A diff')
117 trychange.scm.SVN.GetEmail(self.fake_root).AndReturn('georges@example.com') 118 trychange.scm.SVN.GetEmail(self.fake_root).AndReturn('georges@example.com')
118 self.mox.ReplayAll() 119 self.mox.ReplayAll()
119 svn = trychange.SVN(self.options, self.fake_root, self.options.files) 120 svn = trychange.SVN(self.options, self.fake_root, self.options.files)
120 self.assertEqual(svn.GetFileNames(), self.expected_files) 121 self.assertEqual(svn.GetFileNames(), self.expected_files)
(...skipping 24 matching lines...) Expand all
145 trychange.scm.GIT.GetEmail(self.fake_root).AndReturn('georges@example.com') 146 trychange.scm.GIT.GetEmail(self.fake_root).AndReturn('georges@example.com')
146 self.mox.ReplayAll() 147 self.mox.ReplayAll()
147 git = trychange.GIT(self.options, self.fake_root, self.options.files) 148 git = trychange.GIT(self.options, self.fake_root, self.options.files)
148 self.assertEqual(git.GetFileNames(), self.expected_files) 149 self.assertEqual(git.GetFileNames(), self.expected_files)
149 self.assertEqual(git.checkout_root, self.fake_root) 150 self.assertEqual(git.checkout_root, self.fake_root)
150 self.assertEqual(git.GenerateDiff(), 'A diff') 151 self.assertEqual(git.GenerateDiff(), 'A diff')
151 152
152 153
153 if __name__ == '__main__': 154 if __name__ == '__main__':
154 unittest.main() 155 unittest.main()
OLDNEW
« no previous file with comments | « gclient.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698