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

Side by Side Diff: tests/scm_unittest.py

Issue 1307001: revinfo: Properly use git HEAD or svn BASE revisions (Closed)
Patch Set: fixed issues with patch set 1 Created 10 years, 9 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
« no previous file with comments | « scm.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/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 scm.py.""" 6 """Unit tests for scm.py."""
7 7
8 from shutil import rmtree 8 from shutil import rmtree
9 import tempfile 9 import tempfile
10 10
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 def setUp(self): 139 def setUp(self):
140 BaseSCMTestCase.setUp(self) 140 BaseSCMTestCase.setUp(self)
141 self.root_dir = self.Dir() 141 self.root_dir = self.Dir()
142 self.args = self.Args() 142 self.args = self.Args()
143 self.url = self.Url() 143 self.url = self.Url()
144 self.relpath = 'asf' 144 self.relpath = 'asf'
145 145
146 def testMembersChanged(self): 146 def testMembersChanged(self):
147 self.mox.ReplayAll() 147 self.mox.ReplayAll()
148 members = [ 148 members = [
149 'COMMAND', 'Capture', 'CaptureHeadRevision', 'CaptureInfo', 149 'COMMAND', 'Capture', 'CaptureBaseRevision', 'CaptureHeadRevision',
150 'CaptureStatus', 'DiffItem', 'GenerateDiff', 'GetCheckoutRoot', 150 'CaptureInfo', 'CaptureStatus', 'DiffItem', 'GenerateDiff',
151 'GetEmail', 'GetFileProperty', 'IsMoved', 151 'GetCheckoutRoot', 'GetEmail', 'GetFileProperty', 'IsMoved',
152 'ReadSimpleAuth', 'Run', 'RunAndFilterOutput', 'RunAndGetFileList', 152 'ReadSimpleAuth', 'Run', 'RunAndFilterOutput', 'RunAndGetFileList',
153 ] 153 ]
154 # If this test fails, you should add the relevant test. 154 # If this test fails, you should add the relevant test.
155 self.compareMembers(scm.SVN, members) 155 self.compareMembers(scm.SVN, members)
156 156
157 def testGetCheckoutRoot(self): 157 def testGetCheckoutRoot(self):
158 self.mox.StubOutWithMock(scm.SVN, 'CaptureInfo') 158 self.mox.StubOutWithMock(scm.SVN, 'CaptureInfo')
159 self.mox.StubOutWithMock(scm, 'GetCasedPath') 159 self.mox.StubOutWithMock(scm, 'GetCasedPath')
160 scm.os.path.abspath(self.root_dir + 'x').AndReturn(self.root_dir) 160 scm.os.path.abspath(self.root_dir + 'x').AndReturn(self.root_dir)
161 scm.GetCasedPath(self.root_dir).AndReturn(self.root_dir) 161 scm.GetCasedPath(self.root_dir).AndReturn(self.root_dir)
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 self.mox.ReplayAll() 324 self.mox.ReplayAll()
325 info = scm.SVN.CaptureStatus(None) 325 info = scm.SVN.CaptureStatus(None)
326 self.assertEquals(info, []) 326 self.assertEquals(info, [])
327 327
328 328
329 if __name__ == '__main__': 329 if __name__ == '__main__':
330 import unittest 330 import unittest
331 unittest.main() 331 unittest.main()
332 332
333 # vim: ts=2:sw=2:tw=80:et: 333 # vim: ts=2:sw=2:tw=80:et:
OLDNEW
« no previous file with comments | « scm.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698