OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import unittest | 5 import unittest |
6 | 6 |
7 from infra_libs.ts_mon import errors | 7 try: |
| 8 from infra_libs.ts_mon.common import errors |
| 9 except ImportError: # pragma: no cover |
| 10 from common import errors |
8 | 11 |
9 | 12 |
10 class ErrorsTest(unittest.TestCase): | 13 class ErrorsTest(unittest.TestCase): |
11 | 14 |
12 def test_decreasing_value(self): | 15 def test_decreasing_value(self): |
13 with self.assertRaises(errors.MonitoringDecreasingValueError) as e: | 16 with self.assertRaises(errors.MonitoringDecreasingValueError) as e: |
14 raise errors.MonitoringDecreasingValueError('test', 1, 0) | 17 raise errors.MonitoringDecreasingValueError('test', 1, 0) |
15 str(e.exception) | 18 str(e.exception) |
16 | 19 |
17 def test_duplicate_registration(self): | 20 def test_duplicate_registration(self): |
(...skipping 28 matching lines...) Expand all Loading... |
46 | 49 |
47 def test_no_configured_monitor_flush(self): | 50 def test_no_configured_monitor_flush(self): |
48 with self.assertRaises(errors.MonitoringNoConfiguredMonitorError) as e: | 51 with self.assertRaises(errors.MonitoringNoConfiguredMonitorError) as e: |
49 raise errors.MonitoringNoConfiguredMonitorError(None) | 52 raise errors.MonitoringNoConfiguredMonitorError(None) |
50 str(e.exception) | 53 str(e.exception) |
51 | 54 |
52 def test_no_configured_target(self): | 55 def test_no_configured_target(self): |
53 with self.assertRaises(errors.MonitoringNoConfiguredTargetError) as e: | 56 with self.assertRaises(errors.MonitoringNoConfiguredTargetError) as e: |
54 raise errors.MonitoringNoConfiguredTargetError('test') | 57 raise errors.MonitoringNoConfiguredTargetError('test') |
55 str(e.exception) | 58 str(e.exception) |
OLD | NEW |