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

Side by Side Diff: tests/scm_unittest.py

Issue 878001: Extract git version check code from gclient_scm.py into scm.py where it belongs. (Closed)
Patch Set: 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 | « 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/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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 self.enabled = self.CreateGitRepo(self.sample_git_import, self.base_path) 111 self.enabled = self.CreateGitRepo(self.sample_git_import, self.base_path)
112 self.fake_root = self.Dir() 112 self.fake_root = self.Dir()
113 113
114 def tearDown(self): 114 def tearDown(self):
115 rmtree(self.root_dir) 115 rmtree(self.root_dir)
116 SuperMoxBaseTestBase.tearDown(self) 116 SuperMoxBaseTestBase.tearDown(self)
117 117
118 def testMembersChanged(self): 118 def testMembersChanged(self):
119 self.mox.ReplayAll() 119 self.mox.ReplayAll()
120 members = [ 120 members = [
121 'COMMAND', 'Capture', 'CaptureStatus', 'FetchUpstreamTuple', 121 'COMMAND', 'AssertVersion', 'Capture', 'CaptureStatus',
122 'FetchUpstreamTuple',
122 'GenerateDiff', 'GetBranch', 'GetBranchRef', 'GetCheckoutRoot', 123 'GenerateDiff', 'GetBranch', 'GetBranchRef', 'GetCheckoutRoot',
123 'GetDifferentFiles', 'GetEmail', 'GetPatchName', 'GetSVNBranch', 124 'GetDifferentFiles', 'GetEmail', 'GetPatchName', 'GetSVNBranch',
124 'GetUpstream', 'IsGitSvn', 'RunAndFilterOutput', 'ShortBranchName', 125 'GetUpstream', 'IsGitSvn', 'RunAndFilterOutput', 'ShortBranchName',
125 ] 126 ]
126 # If this test fails, you should add the relevant test. 127 # If this test fails, you should add the relevant test.
127 self.compareMembers(scm.GIT, members) 128 self.compareMembers(scm.GIT, members)
128 129
129 def testGetEmail(self): 130 def testGetEmail(self):
130 self.mox.StubOutWithMock(scm.GIT, 'Capture') 131 self.mox.StubOutWithMock(scm.GIT, 'Capture')
131 scm.GIT.Capture(['config', 'user.email'], self.fake_root, error_ok=True 132 scm.GIT.Capture(['config', 'user.email'], self.fake_root, error_ok=True
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 self.mox.ReplayAll() 324 self.mox.ReplayAll()
324 info = scm.SVN.CaptureStatus(None) 325 info = scm.SVN.CaptureStatus(None)
325 self.assertEquals(info, []) 326 self.assertEquals(info, [])
326 327
327 328
328 if __name__ == '__main__': 329 if __name__ == '__main__':
329 import unittest 330 import unittest
330 unittest.main() 331 unittest.main()
331 332
332 # vim: ts=2:sw=2:tw=80:et: 333 # vim: ts=2:sw=2:tw=80:et:
OLDNEW
« no previous file with comments | « tests/gclient_scm_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698