Browse Source

Add TimerTestCase missing tests case

A tests case class have been missed is the namespace removal changes.

Change-Id: Ie2984260fc6ab74c5766d73c98dd9b1d05d8ee2d
changes/37/147537/1
Mehdi Abaakouk 7 years ago
parent
commit
0c49f0d0ca
1 changed files with 15 additions and 0 deletions
  1. +15
    -0
      oslo_messaging/tests/test_utils.py

+ 15
- 0
oslo_messaging/tests/test_utils.py View File

@ -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)

Loading…
Cancel
Save