diff options
| author | Zuul <zuul@review.opendev.org> | 2020-06-11 15:44:42 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2020-06-11 15:44:42 +0000 |
| commit | 3e6874dc87c166a92ed95dce46900742385f3ba7 (patch) | |
| tree | d3d8358e7e54b77ef1d32ca61da5c427562fe367 /openstackclient | |
| parent | 7f08bf7577388bed48fdc13ea4c26c9c7e9001c6 (diff) | |
| parent | 7696593dc18aff34ab0abbc9020616b608219e58 (diff) | |
| download | python-openstackclient-3e6874dc87c166a92ed95dce46900742385f3ba7.tar.gz | |
Merge "Remove os-client-config references"
Diffstat (limited to 'openstackclient')
| -rw-r--r-- | openstackclient/tests/unit/integ/cli/test_shell.py | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/openstackclient/tests/unit/integ/cli/test_shell.py b/openstackclient/tests/unit/integ/cli/test_shell.py index 0c98a129..5788b473 100644 --- a/openstackclient/tests/unit/integ/cli/test_shell.py +++ b/openstackclient/tests/unit/integ/cli/test_shell.py @@ -20,16 +20,6 @@ from openstackclient import shell from openstackclient.tests.unit.integ import base as test_base from openstackclient.tests.unit import test_shell -# NOTE(dtroyer): Attempt the import to detect if the SDK installed is new -# enough to contain the os_client_config code. If so, use -# that path for mocks. -CONFIG_MOCK_BASE = "openstack.config.loader" -try: - from openstack.config import defaults # noqa -except ImportError: - # Fall back to os-client-config - CONFIG_MOCK_BASE = "os_client_config.config" - class TestIntegShellCliNoAuth(test_base.TestInteg): @@ -455,8 +445,8 @@ class TestIntegShellCliPrecedenceOCC(test_base.TestInteg): temp_dir = self.useFixture(fixtures.TempDir()) return temp_dir.join(filename) - @mock.patch(CONFIG_MOCK_BASE + ".OpenStackConfig._load_vendor_file") - @mock.patch(CONFIG_MOCK_BASE + ".OpenStackConfig._load_config_file") + @mock.patch("openstack.config.loader.OpenStackConfig._load_vendor_file") + @mock.patch("openstack.config.loader.OpenStackConfig._load_config_file") def test_shell_args_precedence_1(self, config_mock, vendor_mock): """Precedence run 1 @@ -473,7 +463,6 @@ class TestIntegShellCliPrecedenceOCC(test_base.TestInteg): return ('file.yaml', copy.deepcopy(test_shell.PUBLIC_1)) vendor_mock.side_effect = vendor_mock_return - print("CONFIG_MOCK_BASE=%s" % CONFIG_MOCK_BASE) _shell = shell.OpenStackShell() _shell.run( "--os-password qaz extension list".split(), @@ -527,8 +516,8 @@ class TestIntegShellCliPrecedenceOCC(test_base.TestInteg): # +env, +cli, +occ # see test_shell_args_precedence_2() - @mock.patch(CONFIG_MOCK_BASE + ".OpenStackConfig._load_vendor_file") - @mock.patch(CONFIG_MOCK_BASE + ".OpenStackConfig._load_config_file") + @mock.patch("openstack.config.loader.OpenStackConfig._load_vendor_file") + @mock.patch("openstack.config.loader.OpenStackConfig._load_config_file") def test_shell_args_precedence_2(self, config_mock, vendor_mock): """Precedence run 2 @@ -545,7 +534,6 @@ class TestIntegShellCliPrecedenceOCC(test_base.TestInteg): return ('file.yaml', copy.deepcopy(test_shell.PUBLIC_1)) vendor_mock.side_effect = vendor_mock_return - print("CONFIG_MOCK_BASE=%s" % CONFIG_MOCK_BASE) _shell = shell.OpenStackShell() _shell.run( "--os-username zarquon --os-password qaz " |
