Chromium Code Reviews| Index: tests/pending_manager_test.py |
| diff --git a/tests/pending_manager_test.py b/tests/pending_manager_test.py |
| index 12f73d489555008f213fa6593fd4c3888ccc360b..74cbf2a266c23077d69aeed4ea90976aab7477cb 100755 |
| --- a/tests/pending_manager_test.py |
| +++ b/tests/pending_manager_test.py |
| @@ -106,6 +106,7 @@ class TestPendingManager(mocks.TestCase): |
| [ _try_comment(), |
| 'close_issue(%d)' % issue, |
| "update_description(%d, u'foo')" % issue, |
| + "set_flag(%d, 1, 'commit', False)" % issue, |
|
Sergey Berezin
2014/02/01 01:24:58
Since committing a message calls _discard_pending(
|
| "add_comment(%d, 'Change committed as 125')" % issue]) |
| else: |
| self.context.checkout.check_calls( |
| @@ -123,6 +124,7 @@ class TestPendingManager(mocks.TestCase): |
| [ _try_comment(), |
| 'close_issue(%d)' % issue, |
| "update_description(%d, u'foo')" % issue, |
| + "set_flag(%d, 1, 'commit', False)" % issue, |
| "add_comment(%d, 'Change committed as 125')" % issue]) |
| else: |
| # checkout is never touched in that case. |
| @@ -210,7 +212,8 @@ class TestPendingManager(mocks.TestCase): |
| self._check_standard_verification(pc, result == base.SUCCEEDED, False) |
| if result == base.SUCCEEDED: |
| - self.context.status.check_names(['initial', 'why not', 'commit']) |
| + self.context.status.check_names( |
| + ['initial', 'why not', 'commit', 'abort']) |
| elif send_initial_packet: |
| self.context.status.check_names(['initial', 'abort']) |
| else: |
| @@ -289,7 +292,7 @@ class TestPendingManager(mocks.TestCase): |
| self._check_standard_verification(pc, result == base.SUCCEEDED, True) |
| if result == base.SUCCEEDED: |
| self.context.status.check_names(['initial', 'why not', 'why not', |
| - 'why not', 'commit']) |
| + 'why not', 'commit', 'abort']) |
| else: |
| self.context.status.check_names(['initial', 'why not', 'why not', |
| 'abort']) |
| @@ -356,7 +359,7 @@ class TestPendingManager(mocks.TestCase): |
| self._check_standard_verification( |
| pc, all(x == base.SUCCEEDED for x in (f1, f2, f3, f4)), False) |
| if all(x == base.SUCCEEDED for x in (f1, f2, f3, f4)): |
| - self.context.status.check_names(['initial', 'why not', 'commit']) |
| + self.context.status.check_names(['initial', 'why not', 'commit', 'abort']) |
| else: |
| self.context.status.check_names(['initial', 'abort']) |
| @@ -407,7 +410,7 @@ class TestPendingManager(mocks.TestCase): |
| pc, all(x == base.SUCCEEDED for x in (f1, f2, f3, f4)), False) |
| if all(x == base.SUCCEEDED for x in (f1, f2, f3, f4)): |
| self.context.status.check_names(['initial', 'why not', 'why not', |
| - 'why not', 'commit']) |
| + 'why not', 'commit', 'abort']) |
| else: |
| self.context.status.check_names(['initial', 'why not', 'why not', |
| 'abort']) |
| @@ -449,8 +452,9 @@ class TestPendingManager(mocks.TestCase): |
| [ _try_comment(), |
| 'close_issue(%d)' % issue, |
| "update_description(%d, u'foo')" % issue, |
| + "set_flag(%d, 1, 'commit', False)" % issue, |
| "add_comment(%d, 'Change committed as 125')" % issue]) |
| - self.context.status.check_names(['initial', 'why not', 'commit']) |
| + self.context.status.check_names(['initial', 'why not', 'commit', 'abort']) |
| def testCommitBurst(self): |
| issue = 31337 |
| @@ -482,21 +486,25 @@ class TestPendingManager(mocks.TestCase): |
| _try_comment(), |
| 'close_issue(0)', |
| "update_description(0, u'foo')", |
| + "set_flag(0, 1, 'commit', False)", |
| "add_comment(0, 'Change committed as 125')", |
| 'close_issue(1)', |
| "update_description(1, u'foo')", |
| + "set_flag(1, 1, 'commit', False)", |
| "add_comment(1, 'Change committed as 125')", |
| 'close_issue(2)', |
| "update_description(2, u'foo')", |
| + "set_flag(2, 1, 'commit', False)", |
| "add_comment(2, 'Change committed as 125')", |
| 'close_issue(3)', |
| "update_description(3, u'foo')", |
| + "set_flag(3, 1, 'commit', False)", |
| "add_comment(3, 'Change committed as 125')", |
| ]) |
| self.assertEqual(3, len(pc.queue.iterate())) |
| total = pc.MAX_COMMIT_BURST + 3 |
| self.context.status.check_names(['initial'] * total + |
| - (['why not', 'commit'] * |
| + (['why not', 'commit', 'abort'] * |
| pc.MAX_COMMIT_BURST) + |
| ['why not'] * 3) |
| @@ -515,9 +523,11 @@ class TestPendingManager(mocks.TestCase): |
| self.context.rietveld.check_calls( |
| [ 'close_issue(%d)' % next_item, |
| "update_description(%d, u'foo')" % next_item, |
| + "set_flag(%d, 1, 'commit', False)" % next_item, |
| "add_comment(%d, 'Change committed as 125')" % next_item, |
| ]) |
| - self.context.status.check_names(['why not', 'commit'] + ['why not'] * 2) |
| + self.context.status.check_names(['why not', 'commit', 'abort'] + |
| + ['why not'] * 2) |
| # After a delay, must flush the queue. |
| timestamp.append(timestamp[-1] + pc.COMMIT_BURST_DELAY + 1) |
| pc.scan_results() |
| @@ -527,11 +537,13 @@ class TestPendingManager(mocks.TestCase): |
| self.context.rietveld.check_calls( |
| [ 'close_issue(%d)' % (next_item + 1), |
| "update_description(%d, u'foo')" % (next_item + 1), |
| + "set_flag(%d, 1, 'commit', False)" % (next_item + 1), |
| "add_comment(%d, 'Change committed as 125')" % (next_item + 1), |
| 'close_issue(%d)' % issue, |
| "update_description(%d, u'foo')" % issue, |
| + "set_flag(%d, 1, 'commit', False)" % issue, |
| "add_comment(%d, 'Change committed as 125')" % issue]) |
| - self.context.status.check_names(['why not', 'commit'] * 2) |
| + self.context.status.check_names(['why not', 'commit', 'abort'] * 2) |
| def testIgnored(self): |
| issue = 31337 |
| @@ -566,8 +578,9 @@ class TestPendingManager(mocks.TestCase): |
| [ _try_comment(), |
| 'close_issue(%d)' % issue, |
| "update_description(%d, u'foo')" % issue, |
| + "set_flag(%d, 1, 'commit', False)" % issue, |
| "add_comment(%d, 'Change committed as 125')" % issue]) |
| - self.context.status.check_names(['initial', 'why not', 'commit']) |
| + self.context.status.check_names(['initial', 'why not', 'commit', 'abort']) |
| self.context.checkout.check_calls( |
| self._prepare_apply_commit(0, issue, server_hooks_missing=True)) |
| @@ -648,8 +661,9 @@ class TestPendingManager(mocks.TestCase): |
| [ _try_comment(), |
| 'close_issue(%d)' % issue, |
| "update_description(%d, u'foo')" % issue, |
| + "set_flag(%d, 1, 'commit', False)" % issue, |
| "add_comment(%d, 'Change committed as 125')" % issue]) |
| - self.context.status.check_names(['initial', 'why not', 'commit']) |
| + self.context.status.check_names(['initial', 'why not', 'commit', 'abort']) |
| self.context.checkout.check_calls( |
| self._prepare_apply_commit(0, issue)) |
| @@ -688,8 +702,9 @@ class TestPendingManager(mocks.TestCase): |
| [ _try_comment(), |
| 'close_issue(%d)' % issue, |
| "update_description(%d, u'foo')" % issue, |
| + "set_flag(%d, 1, 'commit', False)" % issue, |
| "add_comment(%d, 'Change committed as 125')" % issue]) |
| - self.context.status.check_names(['initial', 'why not', 'commit']) |
| + self.context.status.check_names(['initial', 'why not', 'commit', 'abort']) |
| self.context.checkout.check_calls( |
| self._prepare_apply_commit(0, issue)) |
| @@ -720,8 +735,9 @@ class TestPendingManager(mocks.TestCase): |
| [_try_comment(), |
| 'close_issue(%d)' % issue, |
| "update_description(%d, u'foo')" % issue, |
| + "set_flag(%d, 1, 'commit', False)" % issue, |
| "add_comment(%d, 'Change committed as 125')" % issue]) |
| - self.context.status.check_names(['why not', 'commit']) |
| + self.context.status.check_names(['why not', 'commit', 'abort']) |
| self.context.checkout.check_calls( |
| self._prepare_apply_commit(0, issue)) |