Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2006-2009 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 import shutil | 8 import shutil |
| 9 import tempfile | 9 import tempfile |
| 10 | 10 |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 120 'GenerateDiff', 'GetBranch', 'GetBranchRef', 'GetCheckoutRoot', | 120 'GenerateDiff', 'GetBranch', 'GetBranchRef', 'GetCheckoutRoot', |
| 121 'GetDifferentFiles', 'GetEmail', 'GetPatchName', 'GetSVNBranch', | 121 'GetDifferentFiles', 'GetEmail', 'GetPatchName', 'GetSVNBranch', |
| 122 'GetUpstream', 'IsGitSvn', 'RunAndFilterOutput', 'ShortBranchName', | 122 'GetUpstream', 'IsGitSvn', 'RunAndFilterOutput', 'ShortBranchName', |
| 123 ] | 123 ] |
| 124 # If this test fails, you should add the relevant test. | 124 # If this test fails, you should add the relevant test. |
| 125 self.compareMembers(scm.GIT, members) | 125 self.compareMembers(scm.GIT, members) |
| 126 | 126 |
| 127 def testGetEmail(self): | 127 def testGetEmail(self): |
| 128 self.mox.StubOutWithMock(scm.GIT, 'Capture') | 128 self.mox.StubOutWithMock(scm.GIT, 'Capture') |
| 129 scm.GIT.Capture(['config', 'user.email'], self.fake_root, error_ok=True | 129 scm.GIT.Capture(['config', 'user.email'], self.fake_root, error_ok=True |
| 130 ).AndReturn('mini@me.com') | 130 ).AndReturn(['mini@me.com', '']) |
|
Nasser Grainawi
2010/01/31 03:44:35
Shouldn't this be ('mini@me.com', '') since Captur
| |
| 131 self.mox.ReplayAll() | 131 self.mox.ReplayAll() |
| 132 self.assertEqual(scm.GIT.GetEmail(self.fake_root), 'mini@me.com') | 132 self.assertEqual(scm.GIT.GetEmail(self.fake_root), 'mini@me.com') |
| 133 | 133 |
| 134 | 134 |
| 135 class SVNTestCase(BaseSCMTestCase): | 135 class SVNTestCase(BaseSCMTestCase): |
| 136 def setUp(self): | 136 def setUp(self): |
| 137 BaseSCMTestCase.setUp(self) | 137 BaseSCMTestCase.setUp(self) |
| 138 self.root_dir = self.Dir() | 138 self.root_dir = self.Dir() |
| 139 self.args = self.Args() | 139 self.args = self.Args() |
| 140 self.url = self.Url() | 140 self.url = self.Url() |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 321 self.mox.ReplayAll() | 321 self.mox.ReplayAll() |
| 322 info = scm.SVN.CaptureStatus(None) | 322 info = scm.SVN.CaptureStatus(None) |
| 323 self.assertEquals(info, []) | 323 self.assertEquals(info, []) |
| 324 | 324 |
| 325 | 325 |
| 326 if __name__ == '__main__': | 326 if __name__ == '__main__': |
| 327 import unittest | 327 import unittest |
| 328 unittest.main() | 328 unittest.main() |
| 329 | 329 |
| 330 # vim: ts=2:sw=2:tw=80:et: | 330 # vim: ts=2:sw=2:tw=80:et: |
| OLD | NEW |