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

Side by Side Diff: tests/scm_unittest.py

Issue 1739021: Modify scm.GIT.GetUpstreamBranch to behave like git-cl. (Closed)
Patch Set: Created 10 years, 7 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') | tests/trychange_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/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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
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', 'AssertVersion', 'Capture', 'CaptureStatus', 121 'COMMAND', 'AssertVersion', 'Capture', 'CaptureStatus',
122 'FetchUpstreamTuple', 122 'FetchUpstreamTuple',
123 'GenerateDiff', 'GetBranch', 'GetBranchRef', 'GetCheckoutRoot', 123 'GenerateDiff', 'GetBranch', 'GetBranchRef', 'GetCheckoutRoot',
124 'GetDifferentFiles', 'GetEmail', 'GetPatchName', 'GetSVNBranch', 124 'GetDifferentFiles', 'GetEmail', 'GetPatchName', 'GetSVNBranch',
125 'GetUpstream', 'IsGitSvn', 'RunAndFilterOutput', 'ShortBranchName', 125 'GetUpstreamBranch', 'IsGitSvn', 'RunAndFilterOutput',
126 'ShortBranchName',
126 ] 127 ]
127 # If this test fails, you should add the relevant test. 128 # If this test fails, you should add the relevant test.
128 self.compareMembers(scm.GIT, members) 129 self.compareMembers(scm.GIT, members)
129 130
130 def testGetEmail(self): 131 def testGetEmail(self):
131 self.mox.StubOutWithMock(scm.GIT, 'Capture') 132 self.mox.StubOutWithMock(scm.GIT, 'Capture')
132 scm.GIT.Capture(['config', 'user.email'], self.fake_root, error_ok=True 133 scm.GIT.Capture(['config', 'user.email'], self.fake_root, error_ok=True
133 ).AndReturn(['mini@me.com', '']) 134 ).AndReturn(['mini@me.com', ''])
134 self.mox.ReplayAll() 135 self.mox.ReplayAll()
135 self.assertEqual(scm.GIT.GetEmail(self.fake_root), 'mini@me.com') 136 self.assertEqual(scm.GIT.GetEmail(self.fake_root), 'mini@me.com')
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 self.mox.ReplayAll() 326 self.mox.ReplayAll()
326 info = scm.SVN.CaptureStatus(None) 327 info = scm.SVN.CaptureStatus(None)
327 self.assertEquals(info, []) 328 self.assertEquals(info, [])
328 329
329 330
330 if __name__ == '__main__': 331 if __name__ == '__main__':
331 import unittest 332 import unittest
332 unittest.main() 333 unittest.main()
333 334
334 # vim: ts=2:sw=2:tw=80:et: 335 # vim: ts=2:sw=2:tw=80:et:
OLDNEW
« no previous file with comments | « scm.py ('k') | tests/trychange_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698