| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 | 2 |
| 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 """Unit tests for cros_mark_as_stable.py.""" | 7 """Unit tests for cros_mark_as_stable.py.""" |
| 8 | 8 |
| 9 import fileinput | 9 import fileinput |
| 10 import mox | 10 import mox |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 fake_description = 'Marking set of ebuilds as stable\n\n%s' % git_log | 26 fake_description = 'Marking set of ebuilds as stable\n\n%s' % git_log |
| 27 self.mox.StubOutWithMock(cros_mark_as_stable, '_CheckOnStabilizingBranch') | 27 self.mox.StubOutWithMock(cros_mark_as_stable, '_CheckOnStabilizingBranch') |
| 28 self.mox.StubOutWithMock(cros_mark_as_stable.GitBranch, 'CreateBranch') | 28 self.mox.StubOutWithMock(cros_mark_as_stable.GitBranch, 'CreateBranch') |
| 29 self.mox.StubOutWithMock(cros_mark_as_stable.GitBranch, 'Exists') | 29 self.mox.StubOutWithMock(cros_mark_as_stable.GitBranch, 'Exists') |
| 30 | 30 |
| 31 cros_mark_as_stable._CheckOnStabilizingBranch(self._branch).AndReturn(True) | 31 cros_mark_as_stable._CheckOnStabilizingBranch(self._branch).AndReturn(True) |
| 32 cros_mark_as_stable.GitBranch.CreateBranch() | 32 cros_mark_as_stable.GitBranch.CreateBranch() |
| 33 cros_mark_as_stable.GitBranch.Exists().AndReturn(True) | 33 cros_mark_as_stable.GitBranch.Exists().AndReturn(True) |
| 34 cros_mark_as_stable._SimpleRunCommand('git log --format=format:%s%n%n%b ' + | 34 cros_mark_as_stable._SimpleRunCommand('git log --format=format:%s%n%n%b ' + |
| 35 self._tracking_branch + '..').AndReturn(git_log) | 35 self._tracking_branch + '..').AndReturn(git_log) |
| 36 cros_mark_as_stable._SimpleRunCommand('git remote update') | 36 cros_mark_as_stable._SimpleRunCommand('repo sync .') |
| 37 cros_mark_as_stable._SimpleRunCommand('git merge --squash %s' % | 37 cros_mark_as_stable._SimpleRunCommand('git merge --squash %s' % |
| 38 self._branch) | 38 self._branch) |
| 39 cros_mark_as_stable._SimpleRunCommand('git commit -m "%s"' % | 39 cros_mark_as_stable._SimpleRunCommand('git commit -m "%s"' % |
| 40 fake_description) | 40 fake_description) |
| 41 cros_mark_as_stable._SimpleRunCommand('git config push.default tracking') | 41 cros_mark_as_stable._SimpleRunCommand('git config push.default tracking') |
| 42 cros_mark_as_stable._SimpleRunCommand('git push') | 42 cros_mark_as_stable._SimpleRunCommand('git push') |
| 43 self.mox.ReplayAll() | 43 self.mox.ReplayAll() |
| 44 cros_mark_as_stable.PushChange(self._branch, self._tracking_branch) | 44 cros_mark_as_stable.PushChange(self._branch, self._tracking_branch) |
| 45 self.mox.VerifyAll() | 45 self.mox.VerifyAll() |
| 46 | 46 |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 cros_mark_as_stable._FindUprevCandidates([]).AndReturn(package) | 313 cros_mark_as_stable._FindUprevCandidates([]).AndReturn(package) |
| 314 self.mox.ReplayAll() | 314 self.mox.ReplayAll() |
| 315 cros_mark_as_stable._BuildEBuildDictionary(overlays, False, []) | 315 cros_mark_as_stable._BuildEBuildDictionary(overlays, False, []) |
| 316 self.assertEquals(len(overlays), 1) | 316 self.assertEquals(len(overlays), 1) |
| 317 self.assertEquals(overlays["/overlay"], []) | 317 self.assertEquals(overlays["/overlay"], []) |
| 318 self.mox.VerifyAll() | 318 self.mox.VerifyAll() |
| 319 | 319 |
| 320 | 320 |
| 321 if __name__ == '__main__': | 321 if __name__ == '__main__': |
| 322 unittest.main() | 322 unittest.main() |
| OLD | NEW |