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

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

Issue 1260293009: make version of ts_mon compatible with appengine (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: add noncululativedistribution metric to ts_mon imports Created 5 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
« no previous file with comments | « infra_libs/ts_mon/test/distribution_test.py ('k') | infra_libs/ts_mon/test/helpers_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 # 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 import errors
8
9
10 class ErrorsTest(unittest.TestCase):
11
12 def test_decreasing_value(self):
13 with self.assertRaises(errors.MonitoringDecreasingValueError) as e:
14 raise errors.MonitoringDecreasingValueError('test', 1, 0)
15 str(e.exception)
16
17 def test_duplicate_registration(self):
18 with self.assertRaises(errors.MonitoringDuplicateRegistrationError) as e:
19 raise errors.MonitoringDuplicateRegistrationError('test')
20 str(e.exception)
21
22 def test_increment_unset_value(self):
23 with self.assertRaises(errors.MonitoringIncrementUnsetValueError) as e:
24 raise errors.MonitoringIncrementUnsetValueError('test')
25 str(e.exception)
26
27 def test_invalid_value_type(self):
28 with self.assertRaises(errors.MonitoringInvalidValueTypeError) as e:
29 raise errors.MonitoringInvalidValueTypeError('test', 'foo')
30 str(e.exception)
31
32 def test_invalid_field_type(self):
33 with self.assertRaises(errors.MonitoringInvalidFieldTypeError) as e:
34 raise errors.MonitoringInvalidFieldTypeError('test', 'foo', 'bar')
35 str(e.exception)
36
37 def test_too_many_fields(self):
38 with self.assertRaises(errors.MonitoringTooManyFieldsError) as e:
39 raise errors.MonitoringTooManyFieldsError('test', {'foo': 'bar'})
40 str(e.exception)
41
42 def test_no_configured_monitor(self):
43 with self.assertRaises(errors.MonitoringNoConfiguredMonitorError) as e:
44 raise errors.MonitoringNoConfiguredMonitorError('test')
45 str(e.exception)
46
47 def test_no_configured_monitor_flush(self):
48 with self.assertRaises(errors.MonitoringNoConfiguredMonitorError) as e:
49 raise errors.MonitoringNoConfiguredMonitorError(None)
50 str(e.exception)
51
52 def test_no_configured_target(self):
53 with self.assertRaises(errors.MonitoringNoConfiguredTargetError) as e:
54 raise errors.MonitoringNoConfiguredTargetError('test')
55 str(e.exception)
OLDNEW
« no previous file with comments | « infra_libs/ts_mon/test/distribution_test.py ('k') | infra_libs/ts_mon/test/helpers_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698