# Path: oslo_utils/importutils.py
# def import_class(import_str):
# def import_object(import_str, *args, **kwargs):
# def import_object_ns(name_space, import_str, *args, **kwargs):
# def import_module(import_str):
# def import_versioned_module(module, version, submodule=None):
# def try_import(import_str, default=None):
# def import_any(module, *modules):


import datetime
import sys
from oslotest import base as test_base
from oslo_utils import importutils
        obj = importutils.import_object_ns('tests2',
                                           'oslo_utils.tests.fake.FakeDriver',
                                           first_arg=False)
        self.assertEqual(obj.__class__.__name__, 'FakeDriver')

    def test_import_object_ns_full_required_arg_not_present(self):
        # arg 1 isn't optional here
        self.assertRaises(TypeError, importutils.import_object_ns,
                          'tests2', 'oslo_utils.tests.fake.FakeDriver2')

    def test_import_object_ns_full_required_arg_present(self):
        obj = importutils.import_object_ns('tests2',
                                           'oslo_utils.tests.fake.FakeDriver2',
                                           first_arg=False)
        self.assertEqual(obj.__class__.__name__, 'FakeDriver2')

    def test_import_object_ns_raise_import_error_in_init(self):
        self.assertRaises(ImportError, importutils.import_object_ns,
                          'tests2', 'oslo_utils.tests.fake.FakeDriver3')

    def test_import_object(self):
        dt = importutils.import_object('datetime.time')
        self.assertIsInstance(dt, sys.modules['datetime'].time)

    def test_import_object_with_args(self):
        dt = importutils.import_object('datetime.datetime', 2012, 4, 5)
        self.assertIsInstance(dt, sys.modules['datetime'].datetime)
        self.assertEqual(dt, datetime.datetime(2012, 4, 5))

    def test_import_versioned_module(self):

# Path: oslo_utils/importutils.py
# def import_class(import_str):
# def import_object(import_str, *args, **kwargs):
# def import_object_ns(name_space, import_str, *args, **kwargs):
# def import_module(import_str):
# def import_versioned_module(module, version, submodule=None):
# def try_import(import_str, default=None):
# def import_any(module, *modules):


# Path: oslo_utils/tests/test_importutils.py
import datetime
import sys
from oslotest import base as test_base
from oslo_utils import importutils

        obj = importutils.import_object_ns('tests2',
                                           'oslo_utils.tests.fake.FakeDriver',
                                           first_arg=False)
        self.assertEqual(obj.__class__.__name__, 'FakeDriver')

    def test_import_object_ns_full_required_arg_not_present(self):
        # arg 1 isn't optional here
        self.assertRaises(TypeError, importutils.import_object_ns,
                          'tests2', 'oslo_utils.tests.fake.FakeDriver2')

    def test_import_object_ns_full_required_arg_present(self):
        obj = importutils.import_object_ns('tests2',
                                           'oslo_utils.tests.fake.FakeDriver2',
                                           first_arg=False)
        self.assertEqual(obj.__class__.__name__, 'FakeDriver2')

    def test_import_object_ns_raise_import_error_in_init(self):
        self.assertRaises(ImportError, importutils.import_object_ns,
                          'tests2', 'oslo_utils.tests.fake.FakeDriver3')

    def test_import_object(self):
        dt = importutils.import_object('datetime.time')
        self.assertIsInstance(dt, sys.modules['datetime'].time)

    def test_import_object_with_args(self):
        dt = importutils.import_object('datetime.datetime', 2012, 4, 5)
        self.assertIsInstance(dt, sys.modules['datetime'].datetime)
        self.assertEqual(dt, datetime.datetime(2012, 4, 5))

    def test_import_versioned_module(self):

        v2 = importutils.import_versioned_module('oslo_utils.tests.fake', 2)