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

Side by Side Diff: tests/project_test.py

Issue 13560013: Fix errors in async_push.py and test code. (Closed) Base URL: https://git.chromium.org/chromium/tools/commit-queue.git@master
Patch Set: Created 7 years, 8 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
« no previous file with comments | « async_push.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 """Integration tests for project.py.""" 6 """Integration tests for project.py."""
7 7
8 import logging 8 import logging
9 import os 9 import os
10 import random 10 import random
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 @staticmethod 43 @staticmethod
44 def get(user): 44 def get(user):
45 return '1%s1' % user 45 return '1%s1' % user
46 46
47 47
48 class TestCase(mocks.TestCase): 48 class TestCase(mocks.TestCase):
49 def setUp(self): 49 def setUp(self):
50 super(TestCase, self).setUp() 50 super(TestCase, self).setUp()
51 self.mock(projects.creds, 'Credentials', CredentialsMock) 51 self.mock(projects.creds, 'Credentials', CredentialsMock)
52 self.mock(projects, '_read_lines', self._read_lines) 52 self.mock(projects, '_read_lines', self._read_lines)
53 self.mock(
54 projects.async_push,
55 'AsyncPush', lambda _1, _2: mocks.AsyncPushMock(self))
53 class Dummy(object): 56 class Dummy(object):
54 @staticmethod 57 @staticmethod
55 def get_list(): 58 def get_list():
56 return [] 59 return []
57 if not projects.chromium_committers: 60 if not projects.chromium_committers:
58 projects.chromium_committers = Dummy() 61 projects.chromium_committers = Dummy()
59 self.mock( 62 self.mock(
60 projects.chromium_committers, 'get_list', self._get_committers_list) 63 projects.chromium_committers, 'get_list', self._get_committers_list)
61 if not projects.nacl_committers: 64 if not projects.nacl_committers:
62 projects.nacl_committers = Dummy() 65 projects.nacl_committers = Dummy()
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 ] 496 ]
494 self._verify_final_state(pending_manager.queue.get(issue).verifications, 497 self._verify_final_state(pending_manager.queue.get(issue).verifications,
495 why_not, rietveld_calls) 498 why_not, rietveld_calls)
496 499
497 500
498 if __name__ == '__main__': 501 if __name__ == '__main__':
499 logging.basicConfig( 502 logging.basicConfig(
500 level=logging.DEBUG if '-v' in sys.argv else logging.WARNING, 503 level=logging.DEBUG if '-v' in sys.argv else logging.WARNING,
501 format='%(levelname)5s %(module)15s(%(lineno)3d): %(message)s') 504 format='%(levelname)5s %(module)15s(%(lineno)3d): %(message)s')
502 unittest.main() 505 unittest.main()
OLDNEW
« no previous file with comments | « async_push.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698