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 """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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 "[u'browser_tests']})" % issue, | 428 "[u'browser_tests']})" % issue, |
429 "trigger_try_jobs(%d, 1, 'CQ', False, 'HEAD', {u'mac_rel': " | 429 "trigger_try_jobs(%d, 1, 'CQ', False, 'HEAD', {u'mac_rel': " |
430 "[u'browser_tests']})" % issue, | 430 "[u'browser_tests']})" % issue, |
431 "trigger_try_jobs(%d, 1, 'CQ', False, 'HEAD', {u'win_rel': " | 431 "trigger_try_jobs(%d, 1, 'CQ', False, 'HEAD', {u'win_rel': " |
432 "[u'browser_tests']})" % issue, | 432 "[u'browser_tests']})" % issue, |
433 ] | 433 ] |
434 self._verify_final_state(pending_manager.queue.get(issue).verifications, | 434 self._verify_final_state(pending_manager.queue.get(issue).verifications, |
435 why_not, rietveld_calls) | 435 why_not, rietveld_calls) |
436 | 436 |
437 def test_tbr(self): | 437 def test_tbr(self): |
438 self.time = map(lambda x: float(x*35), range(15)) | 438 self.time = map(lambda x: float(x*35), range(16)) |
439 self.urlrequests = [ | 439 self.urlrequests = [ |
440 ('https://chromium-status.appspot.com/allstatus?format=json&endTime=85', | 440 ('https://chromium-status.appspot.com/allstatus?format=json&endTime=85', |
441 # Cheap hack here. | 441 # Cheap hack here. |
442 '[]'), | 442 '[]'), |
443 ] | 443 ] |
444 root_dir = os.path.join(os.getcwd(), 'root_dir') | 444 root_dir = os.path.join(os.getcwd(), 'root_dir') |
445 self.read_lines = [ | 445 self.read_lines = [ |
446 [ | 446 [ |
447 os.path.join(root_dir, '.chromium_status_pwd'), | 447 os.path.join(root_dir, '.chromium_status_pwd'), |
448 'chromium-status password', | 448 'chromium-status password', |
(...skipping 30 matching lines...) Expand all Loading... |
479 pc.update_status() | 479 pc.update_status() |
480 pc.scan_results() | 480 pc.scan_results() |
481 self.assertEqual(0, len(pc.queue.iterate())) | 481 self.assertEqual(0, len(pc.queue.iterate())) |
482 # check_calls | 482 # check_calls |
483 self.context.rietveld.check_calls([ | 483 self.context.rietveld.check_calls([ |
484 _try_comment(pc), | 484 _try_comment(pc), |
485 "trigger_try_jobs(31337, 1, 'CQ', False, 'HEAD', " | 485 "trigger_try_jobs(31337, 1, 'CQ', False, 'HEAD', " |
486 "{u'chromium_presubmit': ['presubmit']})", | 486 "{u'chromium_presubmit': ['presubmit']})", |
487 'close_issue(31337)', | 487 'close_issue(31337)', |
488 "update_description(31337, u'foo\\nTBR=')", | 488 "update_description(31337, u'foo\\nTBR=')", |
| 489 "set_flag(31337, 1, 'commit', False)", |
489 "add_comment(31337, 'Change committed as 125')", | 490 "add_comment(31337, 'Change committed as 125')", |
490 ]) | 491 ]) |
491 self.context.checkout.check_calls([ | 492 self.context.checkout.check_calls([ |
492 'prepare(None)', | 493 'prepare(None)', |
493 'apply_patch(%r)' % self.context.rietveld.patchsets[0], | 494 'apply_patch(%r)' % self.context.rietveld.patchsets[0], |
494 'prepare(None)', | 495 'prepare(None)', |
495 'apply_patch(%r)' % self.context.rietveld.patchsets[1], | 496 'apply_patch(%r)' % self.context.rietveld.patchsets[1], |
496 "commit(u'foo\\nTBR=\\n\\nReview URL: http://nowhere/31337', " | 497 "commit(u'foo\\nTBR=\\n\\nReview URL: http://nowhere/31337', " |
497 "u'user@example.com')", | 498 "u'user@example.com')", |
498 ]) | 499 ]) |
499 self.context.status.check_names(['initial', 'why not', 'why not', | 500 self.context.status.check_names(['initial', 'why not', 'why not', |
500 'why not', 'commit']) | 501 'why not', 'commit', 'abort']) |
501 | 502 |
502 | 503 |
503 | 504 |
504 if __name__ == '__main__': | 505 if __name__ == '__main__': |
505 logging.basicConfig( | 506 logging.basicConfig( |
506 level=logging.DEBUG if '-v' in sys.argv else logging.WARNING, | 507 level=logging.DEBUG if '-v' in sys.argv else logging.WARNING, |
507 format='%(levelname)5s %(module)15s(%(lineno)3d): %(message)s') | 508 format='%(levelname)5s %(module)15s(%(lineno)3d): %(message)s') |
508 unittest.main() | 509 unittest.main() |
OLD | NEW |