summaryrefslogtreecommitdiff
path: root/openstackclient/tests/unit/test_shell.py
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2020-10-13 07:22:37 +0000
committerGerrit Code Review <review@openstack.org>2020-10-13 07:22:37 +0000
commit3cc81dded3caad5821589eff7d0833def93573ac (patch)
treeba069bd7cedf1732fc61d2924fae9a99806b3a90 /openstackclient/tests/unit/test_shell.py
parent44f842b1f86dd922d0393ff947314da3dbd83925 (diff)
parent9385113d40f3d9dd77f2d7dfa5ebb71d92635548 (diff)
downloadpython-openstackclient-3cc81dded3caad5821589eff7d0833def93573ac.tar.gz
Merge "Remove oslo.utils"
Diffstat (limited to 'openstackclient/tests/unit/test_shell.py')
-rw-r--r--openstackclient/tests/unit/test_shell.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/openstackclient/tests/unit/test_shell.py b/openstackclient/tests/unit/test_shell.py
index 94f4f44d..366c364e 100644
--- a/openstackclient/tests/unit/test_shell.py
+++ b/openstackclient/tests/unit/test_shell.py
@@ -13,12 +13,12 @@
# under the License.
#
+import importlib
import os
import sys
from unittest import mock
from osc_lib.tests import utils as osc_lib_test_utils
-from oslo_utils import importutils
import wrapt
from openstackclient import shell
@@ -151,12 +151,13 @@ class TestShell(osc_lib_test_utils.TestShell):
super(TestShell, self).setUp()
# TODO(dtroyer): remove this once the shell_class_patch patch is
# released in osc-lib
- self.shell_class = importutils.import_class(self.shell_class_name)
+ mod_str, _sep, class_str = self.shell_class_name.rpartition('.')
+ self.shell_class = getattr(importlib.import_module(mod_str), class_str)
def _assert_admin_token_auth(self, cmd_options, default_args):
with mock.patch(
- self.shell_class_name + ".initialize_app",
- self.app,
+ self.shell_class_name + ".initialize_app",
+ self.app,
):
_shell = osc_lib_test_utils.make_shell(
shell_class=self.shell_class,