| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2009 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 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 gcl.py.""" | 6 """Unit tests for gcl.py.""" |
| 7 | 7 |
| 8 import unittest | 8 import unittest |
| 9 | 9 |
| 10 # Local imports | 10 # Local imports |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 class ChangeInfoUnittest(GclTestsBase): | 170 class ChangeInfoUnittest(GclTestsBase): |
| 171 def setUp(self): | 171 def setUp(self): |
| 172 GclTestsBase.setUp(self) | 172 GclTestsBase.setUp(self) |
| 173 self.mox.StubOutWithMock(gcl, 'GetChangelistInfoFile') | 173 self.mox.StubOutWithMock(gcl, 'GetChangelistInfoFile') |
| 174 self.mox.StubOutWithMock(gcl, 'GetRepositoryRoot') | 174 self.mox.StubOutWithMock(gcl, 'GetRepositoryRoot') |
| 175 | 175 |
| 176 def testChangeInfoMembers(self): | 176 def testChangeInfoMembers(self): |
| 177 self.mox.ReplayAll() | 177 self.mox.ReplayAll() |
| 178 members = [ | 178 members = [ |
| 179 'CloseIssue', 'Delete', 'GetFiles', 'GetFileNames', 'GetLocalRoot', | 179 'CloseIssue', 'Delete', 'GetFiles', 'GetFileNames', 'GetLocalRoot', |
| 180 'Load', 'MissingTests', 'Save', 'UpdateRietveldDescription', | 180 'Exists', 'Load', 'MissingTests', 'Save', 'UpdateRietveldDescription', |
| 181 'description', 'issue', 'name', | 181 'description', 'issue', 'name', |
| 182 'patch', 'patchset', | 182 'patch', 'patchset', |
| 183 ] | 183 ] |
| 184 # If this test fails, you should add the relevant test. | 184 # If this test fails, you should add the relevant test. |
| 185 self.compareMembers(gcl.ChangeInfo('', 0, 0, '', None, self.fake_root_dir), | 185 self.compareMembers(gcl.ChangeInfo('', 0, 0, '', None, self.fake_root_dir), |
| 186 members) | 186 members) |
| 187 | 187 |
| 188 def testChangeInfoBase(self): | 188 def testChangeInfoBase(self): |
| 189 files = [('M', 'foo'), ('A', 'bar')] | 189 files = [('M', 'foo'), ('A', 'bar')] |
| 190 self.mox.ReplayAll() | 190 self.mox.ReplayAll() |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 gcl.os.chdir('somewhere') | 356 gcl.os.chdir('somewhere') |
| 357 self.mox.ReplayAll() | 357 self.mox.ReplayAll() |
| 358 | 358 |
| 359 gcl.UploadCL(change_info, args) | 359 gcl.UploadCL(change_info, args) |
| 360 self.assertEquals(change_info.issue, 1) | 360 self.assertEquals(change_info.issue, 1) |
| 361 self.assertEquals(change_info.patchset, 2) | 361 self.assertEquals(change_info.patchset, 2) |
| 362 | 362 |
| 363 | 363 |
| 364 if __name__ == '__main__': | 364 if __name__ == '__main__': |
| 365 unittest.main() | 365 unittest.main() |
| OLD | NEW |