From 0c49f0d0ca03ebd2bc976bb1139a82770121c345 Mon Sep 17 00:00:00 2001 From: Mehdi Abaakouk Date: Thu, 15 Jan 2015 15:42:42 +0100 Subject: [PATCH] Add TimerTestCase missing tests case A tests case class have been missed is the namespace removal changes. Change-Id: Ie2984260fc6ab74c5766d73c98dd9b1d05d8ee2d --- oslo_messaging/tests/test_utils.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/oslo_messaging/tests/test_utils.py b/oslo_messaging/tests/test_utils.py index 9225c94fb..d57e32ed2 100644 --- a/oslo_messaging/tests/test_utils.py +++ b/oslo_messaging/tests/test_utils.py @@ -13,6 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_messaging._drivers import common from oslo_messaging import _utils as utils from oslo_messaging.tests import utils as test_utils @@ -47,3 +48,17 @@ class VersionIsCompatibleTestCase(test_utils.BaseTestCase): def test_version_is_compatible_no_rev_is_zero(self): self.assertTrue(utils.version_is_compatible('1.23.0', '1.23')) + + +class TimerTestCase(test_utils.BaseTestCase): + def test_duration_is_none(self): + t = common.DecayingTimer() + t.start() + remaining = t.check_return(None) + self.assertEqual(None, remaining) + + def test_duration_is_none_and_maximun_set(self): + t = common.DecayingTimer() + t.start() + remaining = t.check_return(None, maximum=2) + self.assertEqual(2, remaining)