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

Unified Diff: commit-queue/tests/reviewer_lgtm_test.py

Issue 135363007: Delete public commit queue to avoid confusion after move to internal repo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « commit-queue/tests/reduce_test_data.py ('k') | commit-queue/tests/tree_status_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: commit-queue/tests/reviewer_lgtm_test.py
===================================================================
--- commit-queue/tests/reviewer_lgtm_test.py (revision 249146)
+++ commit-queue/tests/reviewer_lgtm_test.py (working copy)
@@ -1,87 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2011 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Unit tests for verification/reviewer_lgtm.py."""
-
-import logging
-import os
-import re
-import sys
-import unittest
-
-ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
-sys.path.insert(0, os.path.join(ROOT_DIR, '..'))
-
-from verification import base
-from verification import reviewer_lgtm
-
-# From tests/
-import mocks
-
-
-class ReviewerLgtmTest(mocks.TestCase):
- def testNoMessage(self):
- self.pending.reviewers = ['reviewer@example.com']
- self._check(reviewer_lgtm.LgtmStatus.NO_COMMENT)
-
- def testLgtmOwner(self):
- self.pending.messages = [
- {'approval': True, 'sender': self.pending.owner}
- ]
- self.pending.reviewers = [self.pending.owner]
- self._check(reviewer_lgtm.LgtmStatus.NO_LGTM)
-
- def testLgtmOk(self):
- self.pending.messages = [
- {'approval': True, 'sender': 'reviewer@example.com'} ]
- self.pending.reviewers = ['reviewer@example.com']
- self._check(None)
-
- def testLgtmWrongDomain(self):
- self.pending.messages = [
- {'approval': True, 'sender': 'georges@example2.com'} ]
- self.pending.reviewers = ['georges@example2.com']
- self._check(reviewer_lgtm.LgtmStatus.NO_LGTM)
-
- def testLgtmBlacklist(self):
- self.pending.messages = [
- {
- 'approval': False, 'text': 'fix your stuff',
- 'sender': 'reviewer@example.com'
- },
- {'approval': True, 'sender': 'commit-bot@example.com'},
- ]
- self.pending.reviewers = ['reviewer@example.com', 'commit-bot@example.com']
- self._check(reviewer_lgtm.LgtmStatus.NO_LGTM)
-
- def testTBR(self):
- self.pending.description = 'Webkit roll\nTBR='
- self._check(None)
-
- def _check(self, error_message):
- ver = reviewer_lgtm.ReviewerLgtmVerifier(
- [r'^[\-\w]+\@example\.com$'],
- [re.escape('commit-bot@example.com')])
- ver.verify(self.pending)
- ver.update_status([self.pending])
- name = reviewer_lgtm.ReviewerLgtmVerifier.name
- self.assertEqual(
- self.pending.verifications.keys(), [name])
- self.assertEqual(
- self.pending.verifications[name].error_message, error_message)
- if error_message:
- self.assertEqual(
- self.pending.verifications[name].get_state(), base.FAILED)
- else:
- self.assertEqual(
- self.pending.verifications[name].get_state(), base.SUCCEEDED)
-
-
-if __name__ == '__main__':
- logging.basicConfig(
- level=[logging.WARNING, logging.INFO, logging.DEBUG][
- min(sys.argv.count('-v'), 2)],
- format='%(levelname)5s %(module)15s(%(lineno)3d): %(message)s')
- unittest.main()
« no previous file with comments | « commit-queue/tests/reduce_test_data.py ('k') | commit-queue/tests/tree_status_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698