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 functools | 5 import functools |
6 import threading | 6 import threading |
7 import time | 7 import time |
8 import unittest | 8 import unittest |
9 | 9 |
10 import mock | 10 import mock |
11 | 11 |
12 from testing_support import auto_stub | 12 from testing_support import auto_stub |
13 | 13 |
14 from infra_libs.ts_mon import errors | |
15 from infra_libs.ts_mon import interface | 14 from infra_libs.ts_mon import interface |
| 15 from infra_libs.ts_mon.common import errors |
16 from infra_libs.ts_mon.test import stubs | 16 from infra_libs.ts_mon.test import stubs |
17 | 17 |
18 | 18 |
19 class GlobalsTest(auto_stub.TestCase): | 19 class GlobalsTest(auto_stub.TestCase): |
20 | 20 |
21 def setUp(self): | 21 def setUp(self): |
22 super(GlobalsTest, self).setUp() | 22 super(GlobalsTest, self).setUp() |
23 self.mock(interface, 'state', stubs.MockState()) | 23 self.mock(interface, 'state', stubs.MockState()) |
24 | 24 |
25 def tearDown(self): | 25 def tearDown(self): |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 | 282 |
283 def test_sleeps_for_minimum_zero_secs(self): | 283 def test_sleeps_for_minimum_zero_secs(self): |
284 self.t.start() | 284 self.t.start() |
285 | 285 |
286 # Flush takes 65 seconds. | 286 # Flush takes 65 seconds. |
287 interface.flush.side_effect = functools.partial(self.increment_time, 65) | 287 interface.flush.side_effect = functools.partial(self.increment_time, 65) |
288 | 288 |
289 self.assertInRange(30, 60, self.stop_event.timeout_wait()) | 289 self.assertInRange(30, 60, self.stop_event.timeout_wait()) |
290 self.assertAlmostEqual(0, self.stop_event.timeout_wait()) | 290 self.assertAlmostEqual(0, self.stop_event.timeout_wait()) |
291 self.assertAlmostEqual(0, self.stop_event.timeout_wait()) | 291 self.assertAlmostEqual(0, self.stop_event.timeout_wait()) |
OLD | NEW |