Use tempest.tests.lib.base instead of tempest.tests.base

Those 2 files were identical. We should use `tempest.tests.lib.base`
now that we are commited to tempest.lib.
Change-Id: I45d73891f3c0829a2378a032dfc02e5ac0ee34b7
This commit is contained in:
Jordan Pittier 2016-03-29 21:21:16 +02:00
parent 6f56a0ec0b
commit 411290482a
27 changed files with 26 additions and 70 deletions

View File

@ -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

View File

@ -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):

View File

@ -14,7 +14,7 @@
import subprocess
from tempest.tests import base
from tempest.tests.lib import base
class TestTempestListPlugins(base.TestCase):

View File

@ -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):

View File

@ -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):

View File

@ -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):

View File

@ -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):

View File

@ -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):

View File

@ -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):

View File

@ -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

View File

@ -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):

View File

@ -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):

View File

@ -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

View File

@ -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):

View File

@ -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):

View File

@ -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):

View File

@ -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):

View File

@ -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__)

View File

@ -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):

View File

@ -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):

View File

@ -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):

View File

@ -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):

View File

@ -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):

View File

@ -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):

View File

@ -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):

View File

@ -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):

View File

@ -19,7 +19,7 @@ import tempfile
import six
from tempest.tests import base
from tempest.tests.lib import base
DEVNULL = open(os.devnull, 'wb')