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

Side by Side Diff: commit-queue/tests/authors_white_list_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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « commit-queue/subversion_config/config ('k') | commit-queue/tests/buildbot_json_test.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 """Unit tests for verification/authors_white_list.py."""
7
8 import os
9 import sys
10 import unittest
11
12 ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
13 sys.path.insert(0, os.path.join(ROOT_DIR, '..'))
14
15 from verification import base
16 from verification import authors_white_list
17
18 # From tests/
19 import mocks
20
21
22 class AuthorTest(mocks.TestCase):
23 def test_rejected(self):
24 self.pending.owner = 'georges@micro.com'
25 self._check(
26 'Can\'t commit because the owner %s not in whitelist' %
27 self.pending.owner)
28
29 def test_allowed(self):
30 self.pending.owner = 'georges@example.com'
31 self._check(None)
32
33 def _check(self, error_message):
34 ver = authors_white_list.AuthorVerifier([r'^[\-\w]+\@example\.com$'])
35 ver.verify(self.pending)
36 ver.update_status([self.pending])
37 name = authors_white_list.AuthorVerifier.name
38 self.assertEqual(self.pending.verifications.keys(), [name])
39 self.assertEqual(
40 self.pending.verifications[name].error_message, error_message)
41 if error_message:
42 self.assertEqual(
43 self.pending.verifications[name].get_state(), base.FAILED)
44 else:
45 self.assertEqual(
46 self.pending.verifications[name].get_state(), base.SUCCEEDED)
47
48
49 if __name__ == '__main__':
50 unittest.main()
OLDNEW
« no previous file with comments | « commit-queue/subversion_config/config ('k') | commit-queue/tests/buildbot_json_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698