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

Side by Side Diff: infra/services/bugdroid/test/log_parser_test.py

Issue 2030003003: Make new bugdroid recognize git footer Bug: 123. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: add no cover Created 4 years, 6 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 | « infra/services/bugdroid/test/__init__.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
(Empty)
1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import unittest
6
7 import infra.services.bugdroid.log_parser as log_parser
8
9
10 class BugLineParserTest(unittest.TestCase):
11 def test_matching_bug(self):
12 for bug, bug_line in [
13 # Keep distinct bug numbers for easy search in case of test failures.
14 (123, 'BUG=123'),
15 (124, 'Bug: 124'),
16 ('chromium:125', 'Bugs: chromium:125'),
17 ]:
18 m = log_parser.BUG_LINE_REGEX.match(bug_line)
19 self.assertIsNotNone(m, '"%s" line must be matched' % bug_line)
20 self.assertEqual(m.groups()[-1], str(bug),
21 '"%s" line matched to %s but %s expected.' % (
22 bug_line, m.groups()[-1], str(bug)))
23
24 def test_not_matching_bug(self):
25 for bug_line in [
26 # Keep distinct bug numbers for easy search in case of test failures.
27 'BUGr=123',
28 'BUGS/124',
29 'someBugs:',
30 ]:
31 m = log_parser.BUG_LINE_REGEX.match(bug_line)
32 self.assertIsNone(m, '"%s" line must not be matched (got %s)' %
33 (bug_line, m.groups()) if m else None)
34
35
36 if __name__ == "__main__":
37 unittest.main()
OLDNEW
« no previous file with comments | « infra/services/bugdroid/test/__init__.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698