Replace using tests.utils with openstack.common.test
It is the first step to replace using tests.utils with openstack.common.test. All these tests don't use mock objects, stubs, config files and use only BaseTestCase class. Change-Id: I511816b5c9e6c5c34ebff199296ee4fc8b84c672 bp: common-unit-tests
This commit is contained in:
parent
2af59ea388
commit
ca9dcaf055
|
@ -19,10 +19,10 @@ import datetime
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from openstack.common import importutils
|
from openstack.common import importutils
|
||||||
from tests import utils
|
from openstack.common import test
|
||||||
|
|
||||||
|
|
||||||
class ImportUtilsTest(utils.BaseTestCase):
|
class ImportUtilsTest(test.BaseTestCase):
|
||||||
|
|
||||||
# NOTE(jkoelker) There has GOT to be a way to test this. But mocking
|
# NOTE(jkoelker) There has GOT to be a way to test this. But mocking
|
||||||
# __import__ is the devil. Right now we just make
|
# __import__ is the devil. Right now we just make
|
||||||
|
|
|
@ -16,10 +16,10 @@
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from openstack.common import network_utils
|
from openstack.common import network_utils
|
||||||
from tests import utils
|
from openstack.common import test
|
||||||
|
|
||||||
|
|
||||||
class NetworkUtilsTest(utils.BaseTestCase):
|
class NetworkUtilsTest(test.BaseTestCase):
|
||||||
|
|
||||||
def test_parse_host_port(self):
|
def test_parse_host_port(self):
|
||||||
self.assertEqual(('server01', 80),
|
self.assertEqual(('server01', 80),
|
||||||
|
|
|
@ -20,10 +20,10 @@ import mock
|
||||||
import six
|
import six
|
||||||
|
|
||||||
from openstack.common import strutils
|
from openstack.common import strutils
|
||||||
from tests import utils
|
from openstack.common import test
|
||||||
|
|
||||||
|
|
||||||
class StrUtilsTest(utils.BaseTestCase):
|
class StrUtilsTest(test.BaseTestCase):
|
||||||
|
|
||||||
def test_bool_bool_from_string(self):
|
def test_bool_bool_from_string(self):
|
||||||
self.assertTrue(strutils.bool_from_string(True))
|
self.assertTrue(strutils.bool_from_string(True))
|
||||||
|
|
|
@ -21,11 +21,11 @@ import datetime
|
||||||
import iso8601
|
import iso8601
|
||||||
import mock
|
import mock
|
||||||
|
|
||||||
|
from openstack.common import test
|
||||||
from openstack.common import timeutils
|
from openstack.common import timeutils
|
||||||
from tests import utils
|
|
||||||
|
|
||||||
|
|
||||||
class TimeUtilsTest(utils.BaseTestCase):
|
class TimeUtilsTest(test.BaseTestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(TimeUtilsTest, self).setUp()
|
super(TimeUtilsTest, self).setUp()
|
||||||
|
@ -181,7 +181,7 @@ class TimeUtilsTest(utils.BaseTestCase):
|
||||||
self.assertTrue(timeutils.is_soon(expires, 0))
|
self.assertTrue(timeutils.is_soon(expires, 0))
|
||||||
|
|
||||||
|
|
||||||
class TestIso8601Time(utils.BaseTestCase):
|
class TestIso8601Time(test.BaseTestCase):
|
||||||
|
|
||||||
def _instaneous(self, timestamp, yr, mon, day, hr, min, sec, micro):
|
def _instaneous(self, timestamp, yr, mon, day, hr, min, sec, micro):
|
||||||
self.assertEquals(timestamp.year, yr)
|
self.assertEquals(timestamp.year, yr)
|
||||||
|
|
Loading…
Reference in New Issue