Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(131)

Side by Side Diff: tests/pending_manager_test.py

Issue 145293006: Sort issues by their age in the commit queue. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/commit-queue
Patch Set: Addressing the comments Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« pending_manager.py ('K') | « tests/commit_queue_test.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 pending_manager.py.""" 6 """Unit tests for pending_manager.py."""
7 7
8 import logging 8 import logging
9 import os 9 import os
10 import re 10 import re
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 issue)) 55 issue))
56 56
57 57
58 class TestPendingManager(mocks.TestCase): 58 class TestPendingManager(mocks.TestCase):
59 def setUp(self): 59 def setUp(self):
60 super(TestPendingManager, self).setUp() 60 super(TestPendingManager, self).setUp()
61 self.root_dir = ROOT_DIR 61 self.root_dir = ROOT_DIR
62 62
63 def testLoadSave(self): 63 def testLoadSave(self):
64 pc = pending_manager.PendingManager( 64 pc = pending_manager.PendingManager(
65 context.Context(None, None, mocks.AsyncPushMock(self)), 65 context.Context(None, None, mocks.AsyncPushMock(self),
66 'commit-bot@chromium.org'),
66 [fake.FakeVerifier(base.SUCCEEDED)], 67 [fake.FakeVerifier(base.SUCCEEDED)],
67 []) 68 [])
68 filename = os.path.join(self.root_dir, 'foo.json') 69 filename = os.path.join(self.root_dir, 'foo.json')
69 empty = """{ 70 empty = """{
70 "__persistent_type__": "PendingQueue", 71 "__persistent_type__": "PendingQueue",
71 "pending_commits": {} 72 "pending_commits": {}
72 } 73 }
73 """ 74 """
74 write(filename, empty) 75 write(filename, empty)
75 try: 76 try:
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 self.context.checkout.check_calls( 726 self.context.checkout.check_calls(
726 self._prepare_apply_commit(0, issue)) 727 self._prepare_apply_commit(0, issue))
727 728
728 729
729 if __name__ == '__main__': 730 if __name__ == '__main__':
730 logging.basicConfig( 731 logging.basicConfig(
731 level=[logging.ERROR, logging.WARNING, logging.INFO, logging.DEBUG][ 732 level=[logging.ERROR, logging.WARNING, logging.INFO, logging.DEBUG][
732 min(sys.argv.count('-v'), 3)], 733 min(sys.argv.count('-v'), 3)],
733 format='%(levelname)5s %(module)15s(%(lineno)3d): %(message)s') 734 format='%(levelname)5s %(module)15s(%(lineno)3d): %(message)s')
734 unittest.main() 735 unittest.main()
OLDNEW
« pending_manager.py ('K') | « tests/commit_queue_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698