diff options
author | Victor Sergeyev <vsergeyev@mirantis.com> | 2014-04-15 13:05:35 +0300 |
---|---|---|
committer | Victor Sergeyev <vsergeyev@mirantis.com> | 2014-04-15 13:05:35 +0300 |
commit | 9d86c94dc4442b60269d1a4b944d1dabc9a695fb (patch) | |
tree | 3b367ac3361d9ecb0352d876cac48fbfc8270ebe | |
parent | c7fa1865128de9538458fda72541ae04eba5483c (diff) | |
download | oslo-utils-9d86c94dc4442b60269d1a4b944d1dabc9a695fb.tar.gz |
Use oslotest instead of common test module
Module openstack.common.test is obsolete, so we should use
oslotest library instead of it.
Modified tests and common database code, new requirement added.
Change-Id: I853e548f11a4c3785eaf75124510a6d789536634
-rw-r--r-- | tests/unit/test_excutils.py | 6 | ||||
-rw-r--r-- | tests/unit/test_importutils.py | 5 | ||||
-rw-r--r-- | tests/unit/test_network_utils.py | 5 | ||||
-rw-r--r-- | tests/unit/test_strutils.py | 6 | ||||
-rw-r--r-- | tests/unit/test_timeutils.py | 6 |
5 files changed, 15 insertions, 13 deletions
diff --git a/tests/unit/test_excutils.py b/tests/unit/test_excutils.py index 61c85a8..671b483 100644 --- a/tests/unit/test_excutils.py +++ b/tests/unit/test_excutils.py @@ -16,16 +16,16 @@ import logging import time import mock +from oslotest import base as test_base from openstack.common import excutils from openstack.common.fixture import moxstubout -from openstack.common import test mox = moxstubout.mox -class SaveAndReraiseTest(test.BaseTestCase): +class SaveAndReraiseTest(test_base.BaseTestCase): def test_save_and_reraise_exception(self): e = None @@ -82,7 +82,7 @@ class SaveAndReraiseTest(test.BaseTestCase): self.assertFalse(log.called) -class ForeverRetryUncaughtExceptionsTest(test.BaseTestCase): +class ForeverRetryUncaughtExceptionsTest(test_base.BaseTestCase): def setUp(self): super(ForeverRetryUncaughtExceptionsTest, self).setUp() diff --git a/tests/unit/test_importutils.py b/tests/unit/test_importutils.py index 0f71f25..88cc735 100644 --- a/tests/unit/test_importutils.py +++ b/tests/unit/test_importutils.py @@ -16,11 +16,12 @@ import datetime import sys +from oslotest import base as test_base + from openstack.common import importutils -from openstack.common import test -class ImportUtilsTest(test.BaseTestCase): +class ImportUtilsTest(test_base.BaseTestCase): # NOTE(jkoelker) There has GOT to be a way to test this. But mocking # __import__ is the devil. Right now we just make diff --git a/tests/unit/test_network_utils.py b/tests/unit/test_network_utils.py index eb8cfcb..8dee0a5 100644 --- a/tests/unit/test_network_utils.py +++ b/tests/unit/test_network_utils.py @@ -13,11 +13,12 @@ # License for the specific language governing permissions and limitations # under the License. +from oslotest import base as test_base + from openstack.common import network_utils -from openstack.common import test -class NetworkUtilsTest(test.BaseTestCase): +class NetworkUtilsTest(test_base.BaseTestCase): def test_parse_host_port(self): self.assertEqual(('server01', 80), diff --git a/tests/unit/test_strutils.py b/tests/unit/test_strutils.py index a6bb679..a97103c 100644 --- a/tests/unit/test_strutils.py +++ b/tests/unit/test_strutils.py @@ -18,17 +18,17 @@ import math import mock +from oslotest import base as test_base import six import testscenarios from openstack.common import strutils -from openstack.common import test from openstack.common import units load_tests = testscenarios.load_tests_apply_scenarios -class StrUtilsTest(test.BaseTestCase): +class StrUtilsTest(test_base.BaseTestCase): def test_bool_bool_from_string(self): self.assertTrue(strutils.bool_from_string(True)) @@ -201,7 +201,7 @@ class StrUtilsTest(test.BaseTestCase): to_slug("\x80strange", errors="ignore")) -class StringToBytesTest(test.BaseTestCase): +class StringToBytesTest(test_base.BaseTestCase): _unit_system = [ ('si', dict(unit_system='SI')), diff --git a/tests/unit/test_timeutils.py b/tests/unit/test_timeutils.py index ea105fa..d5aa5b1 100644 --- a/tests/unit/test_timeutils.py +++ b/tests/unit/test_timeutils.py @@ -19,13 +19,13 @@ import time import iso8601 import mock +from oslotest import base as test_base from testtools import matchers -from openstack.common import test from openstack.common import timeutils -class TimeUtilsTest(test.BaseTestCase): +class TimeUtilsTest(test_base.BaseTestCase): def setUp(self): super(TimeUtilsTest, self).setUp() @@ -215,7 +215,7 @@ class TimeUtilsTest(test.BaseTestCase): self.assertTrue(timeutils.is_soon(expires, 0)) -class TestIso8601Time(test.BaseTestCase): +class TestIso8601Time(test_base.BaseTestCase): def _instaneous(self, timestamp, yr, mon, day, hr, minute, sec, micro): self.assertEqual(timestamp.year, yr) |