OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 commit_queue.py.""" | 6 """Unit tests for commit_queue.py.""" |
7 | 7 |
8 import logging | 8 import logging |
9 import os | 9 import os |
10 import StringIO | 10 import StringIO |
(...skipping 16 matching lines...) Expand all Loading... |
27 | 27 |
28 | 28 |
29 class Stop(Exception): | 29 class Stop(Exception): |
30 pass | 30 pass |
31 | 31 |
32 | 32 |
33 class PendingManagerMock(auto_stub.SimpleMock): | 33 class PendingManagerMock(auto_stub.SimpleMock): |
34 def __init__(self, unit_test): | 34 def __init__(self, unit_test): |
35 super(PendingManagerMock, self).__init__(unit_test) | 35 super(PendingManagerMock, self).__init__(unit_test) |
36 self.context = context.Context( | 36 self.context = context.Context( |
37 mocks.RietveldMock(unit_test), mocks.SvnCheckoutMock(unit_test), None) | 37 mocks.RietveldMock(unit_test), |
| 38 mocks.SvnCheckoutMock(unit_test), |
| 39 None, |
| 40 'commit-bot@chromium.org') |
38 self.count = 0 | 41 self.count = 0 |
39 | 42 |
40 def load(self, *args, **kwargs): | 43 def load(self, *args, **kwargs): |
41 self._register_call(*args, **kwargs) | 44 self._register_call(*args, **kwargs) |
42 | 45 |
43 def save(self, *args, **kwargs): | 46 def save(self, *args, **kwargs): |
44 self._register_call(*args, **kwargs) | 47 self._register_call(*args, **kwargs) |
45 | 48 |
46 def close(self, *args, **kwargs): | 49 def close(self, *args, **kwargs): |
47 self._register_call(*args, **kwargs) | 50 self._register_call(*args, **kwargs) |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 self._check( | 187 self._check( |
185 'stderr', | 188 'stderr', |
186 'CQ loop terminating\n' | 189 'CQ loop terminating\n' |
187 'Traceback (most recent call last):\n' | 190 'Traceback (most recent call last):\n' |
188 'Stop\n\n' | 191 'Stop\n\n' |
189 'Saving db...\ndb save successful.\n') | 192 'Saving db...\ndb save successful.\n') |
190 | 193 |
191 | 194 |
192 if __name__ == '__main__': | 195 if __name__ == '__main__': |
193 unittest.main() | 196 unittest.main() |
OLD | NEW |