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

Side by Side Diff: scripts/master/unittests/exception_notifier_test.py

Issue 720273003: ExceptionNotifier: a new MailNotifier which treats exceptions as failures. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Addressed comments Created 5 years, 11 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 | « scripts/master/exception_notifier.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 #!/usr/bin/env python
2 # Copyright 2014 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 """ExceptionNofifier unittests."""
7
8 import unittest
9
10 import test_env # pylint: disable=W0611
11
12 from buildbot.status import results
13 from master import exception_notifier
14
15
16 class BuildMock(object):
17 # Silence Method could be a function: pylint: disable=R0201
18 def getBuilder(self):
19 return None
20
21
22 class ExceptionNotifierTest(unittest.TestCase):
23 def test_mode_failing(self):
24 notifier = exception_notifier.ExceptionNotifier(
25 fromaddr='buildbot@test',
26 mode='failing',
27 )
28 self.assertTrue(notifier)
29 self.assertTrue(notifier.isMailNeeded(BuildMock(), results.EXCEPTION))
30 self.assertTrue(notifier.isMailNeeded(BuildMock(), results.FAILURE))
31 self.assertFalse(notifier.isMailNeeded(BuildMock(), results.SUCCESS))
32
33
34 if __name__ == '__main__':
35 unittest.main()
OLDNEW
« no previous file with comments | « scripts/master/exception_notifier.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698