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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 | 111 |
112 def tearDown(self): | 112 def tearDown(self): |
113 shutil.rmtree(self.root_dir) | 113 shutil.rmtree(self.root_dir) |
114 SuperMoxBaseTestBase.tearDown(self) | 114 SuperMoxBaseTestBase.tearDown(self) |
115 | 115 |
116 def testMembersChanged(self): | 116 def testMembersChanged(self): |
117 self.mox.ReplayAll() | 117 self.mox.ReplayAll() |
118 members = [ | 118 members = [ |
119 'COMMAND', 'Capture', 'CaptureStatus', 'FetchUpstreamTuple', | 119 'COMMAND', 'Capture', 'CaptureStatus', 'FetchUpstreamTuple', |
120 'GenerateDiff', 'GetBranch', 'GetBranchRef', 'GetCheckoutRoot', | 120 'GenerateDiff', 'GetBranch', 'GetBranchRef', 'GetCheckoutRoot', |
121 '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') |
131 self.mox.ReplayAll() | 131 self.mox.ReplayAll() |
(...skipping 189 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 |