diff --git a/tempest/tests/base.py b/tempest/tests/base.py deleted file mode 100644 index fe9268e766..0000000000 --- a/tempest/tests/base.py +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright 2013 IBM Corp. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -import mock -from oslotest import base -from oslotest import moxstubout - - -class TestCase(base.BaseTestCase): - - def setUp(self): - super(TestCase, self).setUp() - mox_fixture = self.useFixture(moxstubout.MoxStubout()) - self.mox = mox_fixture.mox - self.stubs = mox_fixture.stubs - - def patch(self, target, **kwargs): - """Returns a started `mock.patch` object for the supplied target. - - The caller may then call the returned patcher to create a mock object. - - The caller does not need to call stop() on the returned - patcher object, as this method automatically adds a cleanup - to the test class to stop the patcher. - - :param target: String module.class or module.object expression to patch - :param **kwargs: Passed as-is to `mock.patch`. See mock documentation - for details. - """ - p = mock.patch(target, **kwargs) - m = p.start() - self.addCleanup(p.stop) - return m diff --git a/tempest/tests/cmd/test_javelin.py b/tempest/tests/cmd/test_javelin.py index 2d0256a333..b8c9969936 100644 --- a/tempest/tests/cmd/test_javelin.py +++ b/tempest/tests/cmd/test_javelin.py @@ -17,7 +17,7 @@ from oslotest import mockpatch from tempest.cmd import javelin from tempest.lib import exceptions as lib_exc -from tempest.tests import base +from tempest.tests.lib import base class JavelinUnitTest(base.TestCase): diff --git a/tempest/tests/cmd/test_list_plugins.py b/tempest/tests/cmd/test_list_plugins.py index 17ddb18287..782dde7416 100644 --- a/tempest/tests/cmd/test_list_plugins.py +++ b/tempest/tests/cmd/test_list_plugins.py @@ -14,7 +14,7 @@ import subprocess -from tempest.tests import base +from tempest.tests.lib import base class TestTempestListPlugins(base.TestCase): diff --git a/tempest/tests/cmd/test_tempest_init.py b/tempest/tests/cmd/test_tempest_init.py index 685a0b3e18..6c5326a922 100644 --- a/tempest/tests/cmd/test_tempest_init.py +++ b/tempest/tests/cmd/test_tempest_init.py @@ -18,7 +18,7 @@ import shutil import fixtures from tempest.cmd import init -from tempest.tests import base +from tempest.tests.lib import base class TestTempestInit(base.TestCase): diff --git a/tempest/tests/cmd/test_verify_tempest_config.py b/tempest/tests/cmd/test_verify_tempest_config.py index dc0ba6f34d..5d050d1796 100644 --- a/tempest/tests/cmd/test_verify_tempest_config.py +++ b/tempest/tests/cmd/test_verify_tempest_config.py @@ -19,8 +19,8 @@ from oslotest import mockpatch from tempest.cmd import verify_tempest_config from tempest import config -from tempest.tests import base from tempest.tests import fake_config +from tempest.tests.lib import base class TestGetAPIVersions(base.TestCase): diff --git a/tempest/tests/common/test_admin_available.py b/tempest/tests/common/test_admin_available.py index 98e76b997a..c8035413b4 100644 --- a/tempest/tests/common/test_admin_available.py +++ b/tempest/tests/common/test_admin_available.py @@ -17,8 +17,8 @@ from oslotest import mockpatch from tempest.common import credentials_factory as credentials from tempest import config -from tempest.tests import base from tempest.tests import fake_config +from tempest.tests.lib import base class TestAdminAvailable(base.TestCase): diff --git a/tempest/tests/common/test_alt_available.py b/tempest/tests/common/test_alt_available.py index 48e4a3e9b3..cb1de16669 100644 --- a/tempest/tests/common/test_alt_available.py +++ b/tempest/tests/common/test_alt_available.py @@ -17,8 +17,8 @@ from oslotest import mockpatch from tempest.common import credentials_factory as credentials from tempest import config -from tempest.tests import base from tempest.tests import fake_config +from tempest.tests.lib import base class TestAltAvailable(base.TestCase): diff --git a/tempest/tests/common/test_configured_creds.py b/tempest/tests/common/test_configured_creds.py index be24595680..8c721e6bf3 100644 --- a/tempest/tests/common/test_configured_creds.py +++ b/tempest/tests/common/test_configured_creds.py @@ -21,9 +21,9 @@ from tempest.lib import auth from tempest.lib import exceptions as lib_exc from tempest.lib.services.identity.v2 import token_client as v2_client from tempest.lib.services.identity.v3 import token_client as v3_client -from tempest.tests import base from tempest.tests import fake_config from tempest.tests import fake_identity +from tempest.tests.lib import base class ConfiguredV2CredentialsTests(base.TestCase): diff --git a/tempest/tests/common/test_credentials.py b/tempest/tests/common/test_credentials.py index 136ac022fc..6fc490e4b2 100644 --- a/tempest/tests/common/test_credentials.py +++ b/tempest/tests/common/test_credentials.py @@ -15,8 +15,8 @@ from tempest.common import credentials_factory as credentials from tempest import config from tempest import exceptions -from tempest.tests import base from tempest.tests import fake_config +from tempest.tests.lib import base class TestLegacyCredentialsProvider(base.TestCase): diff --git a/tempest/tests/common/test_custom_matchers.py b/tempest/tests/common/test_custom_matchers.py index 2656a4736d..d6649616fa 100644 --- a/tempest/tests/common/test_custom_matchers.py +++ b/tempest/tests/common/test_custom_matchers.py @@ -14,7 +14,7 @@ # under the License. from tempest.common import custom_matchers -from tempest.tests import base +from tempest.tests.lib import base from testtools.tests.matchers import helpers diff --git a/tempest/tests/common/test_dynamic_creds.py b/tempest/tests/common/test_dynamic_creds.py index a49612d7c4..f2052dc74d 100644 --- a/tempest/tests/common/test_dynamic_creds.py +++ b/tempest/tests/common/test_dynamic_creds.py @@ -31,10 +31,10 @@ from tempest.services.identity.v2.json import tenants_client as \ from tempest.services.identity.v2.json import users_client as \ json_users_client from tempest.services.network.json import routers_client -from tempest.tests import base from tempest.tests import fake_config from tempest.tests import fake_http from tempest.tests import fake_identity +from tempest.tests.lib import base class TestDynamicCredentialProvider(base.TestCase): diff --git a/tempest/tests/common/test_preprov_creds.py b/tempest/tests/common/test_preprov_creds.py index 7af8654c4d..efc5ef6770 100644 --- a/tempest/tests/common/test_preprov_creds.py +++ b/tempest/tests/common/test_preprov_creds.py @@ -28,10 +28,10 @@ from tempest import config from tempest.lib import auth from tempest.lib import exceptions as lib_exc from tempest.lib.services.identity.v2 import token_client -from tempest.tests import base from tempest.tests import fake_config from tempest.tests import fake_http from tempest.tests import fake_identity +from tempest.tests.lib import base class TestPreProvisionedCredentials(base.TestCase): diff --git a/tempest/tests/common/test_waiters.py b/tempest/tests/common/test_waiters.py index 492bdca898..e0cef62f5c 100644 --- a/tempest/tests/common/test_waiters.py +++ b/tempest/tests/common/test_waiters.py @@ -19,7 +19,7 @@ import mock from tempest.common import waiters from tempest import exceptions from tempest.services.volume.base import base_volumes_client -from tempest.tests import base +from tempest.tests.lib import base import tempest.tests.utils as utils diff --git a/tempest/tests/common/utils/linux/test_remote_client.py b/tempest/tests/common/utils/linux/test_remote_client.py index 9c2b99e6f6..22cf47a76c 100644 --- a/tempest/tests/common/utils/linux/test_remote_client.py +++ b/tempest/tests/common/utils/linux/test_remote_client.py @@ -19,8 +19,8 @@ from oslotest import mockpatch from tempest.common.utils.linux import remote_client from tempest import config -from tempest.tests import base from tempest.tests import fake_config +from tempest.tests.lib import base class TestRemoteClient(base.TestCase): diff --git a/tempest/tests/common/utils/test_file_utils.py b/tempest/tests/common/utils/test_file_utils.py index 937aefa323..1a14592281 100644 --- a/tempest/tests/common/utils/test_file_utils.py +++ b/tempest/tests/common/utils/test_file_utils.py @@ -16,7 +16,7 @@ import mock from tempest.common.utils import file_utils -from tempest.tests import base +from tempest.tests.lib import base class TestFileUtils(base.TestCase): diff --git a/tempest/tests/negative/test_negative_auto_test.py b/tempest/tests/negative/test_negative_auto_test.py index 7a127cd3b2..c666bd302d 100644 --- a/tempest/tests/negative/test_negative_auto_test.py +++ b/tempest/tests/negative/test_negative_auto_test.py @@ -15,8 +15,8 @@ from tempest import config import tempest.test as test -from tempest.tests import base from tempest.tests import fake_config +from tempest.tests.lib import base class TestNegativeAutoTest(base.TestCase): diff --git a/tempest/tests/negative/test_negative_generators.py b/tempest/tests/negative/test_negative_generators.py index 78fd80d623..e0d7f421ec 100644 --- a/tempest/tests/negative/test_negative_generators.py +++ b/tempest/tests/negative/test_negative_generators.py @@ -22,7 +22,7 @@ import six from tempest.common.generator import base_generator from tempest.common.generator import negative_generator from tempest.common.generator import valid_generator -from tempest.tests import base +from tempest.tests.lib import base class TestNegativeBasicGenerator(base.TestCase): diff --git a/tempest/tests/stress/test_stress.py b/tempest/tests/stress/test_stress.py index dfe029163f..a35b4d7034 100644 --- a/tempest/tests/stress/test_stress.py +++ b/tempest/tests/stress/test_stress.py @@ -18,7 +18,7 @@ import subprocess from oslo_log import log as logging from tempest.lib import exceptions -from tempest.tests import base +from tempest.tests.lib import base LOG = logging.getLogger(__name__) diff --git a/tempest/tests/test_base_test.py b/tempest/tests/test_base_test.py index dc355b428d..9ffb7a1aa9 100644 --- a/tempest/tests/test_base_test.py +++ b/tempest/tests/test_base_test.py @@ -19,8 +19,8 @@ from tempest.common import credentials_factory as credentials from tempest.common import fixed_network from tempest import config from tempest import test -from tempest.tests import base from tempest.tests import fake_config +from tempest.tests.lib import base class TestBaseTestCase(base.TestCase): diff --git a/tempest/tests/test_decorators.py b/tempest/tests/test_decorators.py index da5e2d7d76..4c9a3b7c0f 100644 --- a/tempest/tests/test_decorators.py +++ b/tempest/tests/test_decorators.py @@ -22,8 +22,8 @@ import testtools from tempest import config from tempest import exceptions from tempest import test -from tempest.tests import base from tempest.tests import fake_config +from tempest.tests.lib import base class BaseDecoratorsTest(base.TestCase): diff --git a/tempest/tests/test_glance_http.py b/tempest/tests/test_glance_http.py index f6076ca902..10f80a78de 100644 --- a/tempest/tests/test_glance_http.py +++ b/tempest/tests/test_glance_http.py @@ -22,9 +22,9 @@ from six.moves import http_client as httplib from tempest.common import glance_http from tempest import exceptions -from tempest.tests import base from tempest.tests import fake_auth_provider from tempest.tests import fake_http +from tempest.tests.lib import base class TestGlanceHTTPClient(base.TestCase): diff --git a/tempest/tests/test_hacking.py b/tempest/tests/test_hacking.py index aba2aabce3..6b3aa0d03c 100644 --- a/tempest/tests/test_hacking.py +++ b/tempest/tests/test_hacking.py @@ -13,7 +13,7 @@ # under the License. from tempest.hacking import checks -from tempest.tests import base +from tempest.tests.lib import base class HackingTestCase(base.TestCase): diff --git a/tempest/tests/test_list_tests.py b/tempest/tests/test_list_tests.py index 38d4c5c0e6..69527b1f74 100644 --- a/tempest/tests/test_list_tests.py +++ b/tempest/tests/test_list_tests.py @@ -17,7 +17,7 @@ import re import six import subprocess -from tempest.tests import base +from tempest.tests.lib import base class TestTestList(base.TestCase): diff --git a/tempest/tests/test_microversions.py b/tempest/tests/test_microversions.py index cef7975719..1ac1232de9 100644 --- a/tempest/tests/test_microversions.py +++ b/tempest/tests/test_microversions.py @@ -18,8 +18,8 @@ import testtools from tempest.api.compute import base as compute_base from tempest import config from tempest.lib import exceptions -from tempest.tests import base from tempest.tests import fake_config +from tempest.tests.lib import base class VersionTestNoneTolatest(compute_base.BaseV2ComputeTest): diff --git a/tempest/tests/test_negative_rest_client.py b/tempest/tests/test_negative_rest_client.py index ce95739a13..6a071b1630 100644 --- a/tempest/tests/test_negative_rest_client.py +++ b/tempest/tests/test_negative_rest_client.py @@ -20,10 +20,10 @@ from oslotest import mockpatch from tempest.common import negative_rest_client from tempest import config -from tempest.tests import base from tempest.tests import fake_auth_provider from tempest.tests import fake_config from tempest.tests import fake_http +from tempest.tests.lib import base class TestNegativeRestClient(base.TestCase): diff --git a/tempest/tests/test_tempest_plugin.py b/tempest/tests/test_tempest_plugin.py index c07e98c012..f66dfc820c 100644 --- a/tempest/tests/test_tempest_plugin.py +++ b/tempest/tests/test_tempest_plugin.py @@ -14,8 +14,8 @@ # under the License. from tempest.test_discover import plugins -from tempest.tests import base from tempest.tests import fake_tempest_plugin as fake_plugin +from tempest.tests.lib import base class TestPluginDiscovery(base.TestCase): diff --git a/tempest/tests/test_wrappers.py b/tempest/tests/test_wrappers.py index a4ef699c47..edb9061512 100644 --- a/tempest/tests/test_wrappers.py +++ b/tempest/tests/test_wrappers.py @@ -19,7 +19,7 @@ import tempfile import six -from tempest.tests import base +from tempest.tests.lib import base DEVNULL = open(os.devnull, 'wb')