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

Side by Side Diff: infra_libs/ts_mon/common/test/errors_test.py

Issue 2213143002: Add infra_libs as a bootstrap dependency. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Removed the ugly import hack Created 4 years, 4 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
OLDNEW
(Empty)
1 # Copyright 2015 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 from infra_libs.ts_mon.common import errors
8
9 class ErrorsTest(unittest.TestCase):
10
11 ERRORS = [
12 (errors.MonitoringDecreasingValueError, ('test', 1, 0)),
13 (errors.MonitoringDuplicateRegistrationError, ('test',)),
14 (errors.MonitoringIncrementUnsetValueError, ('test',)),
15 (errors.MonitoringInvalidValueTypeError, ('test', 'foo')),
16 (errors.MonitoringInvalidFieldTypeError, ('test', 'foo', 'bar')),
17 (errors.MonitoringTooManyFieldsError, ('test', {'foo': 'bar'})),
18 (errors.MonitoringNoConfiguredMonitorError, ('test',)),
19 (errors.MonitoringNoConfiguredMonitorError, (None,)),
20 (errors.MonitoringNoConfiguredTargetError, ('test',)),
21 (errors.UnknownModificationTypeError, ('foo',)),
22 ]
23
24 def test_smoke(self):
25 for error_class, args in self.ERRORS:
26 with self.assertRaises(error_class) as e:
27 raise error_class(*args)
28 str(e.exception)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698