OLD | NEW |
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 Loading... |
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 Loading... |
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: |
OLD | NEW |