Move existing tests to unit
The existing test files are all moved under keystone.tests.unit, except the existing keystone.tests.unit are left in place. The .testr.conf is updated so that unit tests are run by default in tox envs, and a tox env can override the tests to run by setting OS_TEST_PATH. This is so functional tests can sit in keystone.tests.functional. Change-Id: I065d3f56e22f344abdadd92b3b384b002b02d989
This commit is contained in:
parent
4a5b0fb34e
commit
115d9660de
@ -3,7 +3,7 @@ test_command=
|
||||
OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
|
||||
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
|
||||
OS_LOG_CAPTURE=${OS_LOG_CAPTURE:-1} \
|
||||
${PYTHON:-python} -m subunit.run discover -t ./ ./keystone/tests $LISTOPT $IDOPTION
|
||||
${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./keystone/tests/unit} $LISTOPT $IDOPTION
|
||||
|
||||
test_id_option=--load-list $IDFILE
|
||||
test_list_option=--list
|
||||
|
@ -1,41 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# 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 oslo_i18n
|
||||
import six
|
||||
|
||||
|
||||
if six.PY3:
|
||||
# NOTE(dstanek): This block will monkey patch libraries that are not
|
||||
# yet supported in Python3. We do this that that it is possible to
|
||||
# execute any tests at all. Without monkey patching modules the
|
||||
# tests will fail with import errors.
|
||||
|
||||
import sys
|
||||
from unittest import mock # noqa: our import detection is naive?
|
||||
|
||||
sys.modules['eventlet'] = mock.Mock()
|
||||
sys.modules['eventlet.green'] = mock.Mock()
|
||||
sys.modules['eventlet.wsgi'] = mock.Mock()
|
||||
sys.modules['oslo'].messaging = mock.Mock()
|
||||
sys.modules['pycadf'] = mock.Mock()
|
||||
sys.modules['paste'] = mock.Mock()
|
||||
|
||||
# NOTE(dstanek): oslo_i18n.enable_lazy() must be called before
|
||||
# keystone.i18n._() is called to ensure it has the desired lazy lookup
|
||||
# behavior. This includes cases, like keystone.exceptions, where
|
||||
# keystone.i18n._() is called at import time.
|
||||
oslo_i18n.enable_lazy()
|
||||
|
||||
from keystone.tests.core import * # noqa
|
@ -0,0 +1,41 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# 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 oslo_i18n
|
||||
import six
|
||||
|
||||
|
||||
if six.PY3:
|
||||
# NOTE(dstanek): This block will monkey patch libraries that are not
|
||||
# yet supported in Python3. We do this that that it is possible to
|
||||
# execute any tests at all. Without monkey patching modules the
|
||||
# tests will fail with import errors.
|
||||
|
||||
import sys
|
||||
from unittest import mock # noqa: our import detection is naive?
|
||||
|
||||
sys.modules['eventlet'] = mock.Mock()
|
||||
sys.modules['eventlet.green'] = mock.Mock()
|
||||
sys.modules['eventlet.wsgi'] = mock.Mock()
|
||||
sys.modules['oslo'].messaging = mock.Mock()
|
||||
sys.modules['pycadf'] = mock.Mock()
|
||||
sys.modules['paste'] = mock.Mock()
|
||||
|
||||
# NOTE(dstanek): oslo_i18n.enable_lazy() must be called before
|
||||
# keystone.i18n._() is called to ensure it has the desired lazy lookup
|
||||
# behavior. This includes cases, like keystone.exceptions, where
|
||||
# keystone.i18n._() is called at import time.
|
||||
oslo_i18n.enable_lazy()
|
||||
|
||||
from keystone.tests.unit.core import * # noqa
|
@ -13,7 +13,7 @@
|
||||
# under the License.
|
||||
|
||||
from keystone.common import base64utils
|
||||
from keystone import tests
|
||||
from keystone.tests import unit as tests
|
||||
|
||||
base64_alphabet = ('ABCDEFGHIJKLMNOPQRSTUVWXYZ'
|
||||
'abcdefghijklmnopqrstuvwxyz'
|
||||
|
@ -19,7 +19,7 @@ from testtools import matchers
|
||||
|
||||
from keystone.common.cache import _memcache_pool
|
||||
from keystone import exception
|
||||
from keystone.tests import core
|
||||
from keystone.tests.unit import core
|
||||
|
||||
|
||||
class _TestConnectionPool(_memcache_pool.ConnectionPool):
|
||||
|
@ -15,7 +15,7 @@
|
||||
import uuid
|
||||
|
||||
from keystone.common import dependency
|
||||
from keystone import tests
|
||||
from keystone.tests import unit as tests
|
||||
|
||||
|
||||
class TestDependencyInjection(tests.BaseTestCase):
|
||||
|
@ -18,7 +18,7 @@ import copy
|
||||
from testtools import matchers
|
||||
|
||||
from keystone.common import json_home
|
||||
from keystone import tests
|
||||
from keystone.tests import unit as tests
|
||||
|
||||
|
||||
class JsonHomeTest(tests.BaseTestCase):
|
||||
|
@ -24,9 +24,9 @@ import tempfile
|
||||
from keystone.common import ldap as ks_ldap
|
||||
from keystone.common.ldap import core as common_ldap_core
|
||||
from keystone import config
|
||||
from keystone import tests
|
||||
from keystone.tests import default_fixtures
|
||||
from keystone.tests import fakeldap
|
||||
from keystone.tests import unit as tests
|
||||
from keystone.tests.unit import default_fixtures
|
||||
from keystone.tests.unit import fakeldap
|
||||
|
||||
CONF = config.CONF
|
||||
|
||||
|
@ -26,7 +26,7 @@ import testtools
|
||||
|
||||
from keystone.common import dependency
|
||||
from keystone import notifications
|
||||
from keystone.tests import test_v3
|
||||
from keystone.tests.unit import test_v3
|
||||
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
@ -17,7 +17,7 @@ import base64
|
||||
from six import moves
|
||||
|
||||
from keystone.common import pemutils
|
||||
from keystone import tests
|
||||
from keystone.tests import unit as tests
|
||||
|
||||
|
||||
# List of 2-tuples, (pem_type, pem_header)
|
||||
|
@ -14,8 +14,8 @@
|
||||
from sqlalchemy.ext import declarative
|
||||
|
||||
from keystone.common import sql
|
||||
from keystone import tests
|
||||
from keystone.tests import utils
|
||||
from keystone.tests import unit as tests
|
||||
from keystone.tests.unit import utils
|
||||
|
||||
|
||||
ModelBase = declarative.declarative_base()
|
||||
|
@ -19,8 +19,8 @@ from keystone.common import utils as common_utils
|
||||
from keystone import config
|
||||
from keystone import exception
|
||||
from keystone import service
|
||||
from keystone import tests
|
||||
from keystone.tests import utils
|
||||
from keystone.tests import unit as tests
|
||||
from keystone.tests.unit import utils
|
||||
|
||||
|
||||
CONF = config.CONF
|
||||
|
@ -1,6 +1,6 @@
|
||||
[auth]
|
||||
methods = external,password,token,simple_challenge_response,saml2,openid,x509
|
||||
simple_challenge_response = keystone.tests.test_auth_plugin.SimpleChallengeResponse
|
||||
simple_challenge_response = keystone.tests.unit.test_auth_plugin.SimpleChallengeResponse
|
||||
saml2 = keystone.auth.plugins.mapped.Mapped
|
||||
openid = keystone.auth.plugins.mapped.Mapped
|
||||
x509 = keystone.auth.plugins.mapped.Mapped
|
@ -53,8 +53,8 @@ from keystone import notifications
|
||||
from keystone.openstack.common import log
|
||||
from keystone.server import common
|
||||
from keystone import service
|
||||
from keystone.tests import ksfixtures
|
||||
from keystone.tests import utils
|
||||
from keystone.tests.unit import ksfixtures
|
||||
from keystone.tests.unit import utils
|
||||
|
||||
|
||||
# NOTE(dstanek): Tests inheriting from TestCase depend on having the
|
||||
@ -69,7 +69,7 @@ LOG = log.getLogger(__name__)
|
||||
PID = six.text_type(os.getpid())
|
||||
TESTSDIR = os.path.dirname(os.path.abspath(__file__))
|
||||
TESTCONF = os.path.join(TESTSDIR, 'config_files')
|
||||
ROOTDIR = os.path.normpath(os.path.join(TESTSDIR, '..', '..'))
|
||||
ROOTDIR = os.path.normpath(os.path.join(TESTSDIR, '..', '..', '..'))
|
||||
VENDOR = os.path.join(ROOTDIR, 'vendor')
|
||||
ETCDIR = os.path.join(ROOTDIR, 'etc')
|
||||
|
||||
@ -312,7 +312,7 @@ class TestCase(BaseTestCase):
|
||||
group='cache',
|
||||
backend='dogpile.cache.memory',
|
||||
enabled=True,
|
||||
proxies=['keystone.tests.test_cache.CacheIsolatingProxy'])
|
||||
proxies=['keystone.tests.unit.test_cache.CacheIsolatingProxy'])
|
||||
self.config_fixture.config(
|
||||
group='catalog',
|
||||
driver='keystone.catalog.backends.templated.Catalog',
|
||||
@ -323,8 +323,9 @@ class TestCase(BaseTestCase):
|
||||
self.config_fixture.config(
|
||||
group='kvs',
|
||||
backends=[
|
||||
'keystone.tests.test_kvs.KVSBackendForcedKeyMangleFixture',
|
||||
'keystone.tests.test_kvs.KVSBackendFixture'])
|
||||
('keystone.tests.unit.test_kvs.'
|
||||
'KVSBackendForcedKeyMangleFixture'),
|
||||
'keystone.tests.unit.test_kvs.KVSBackendFixture'])
|
||||
self.config_fixture.config(
|
||||
group='revoke',
|
||||
driver='keystone.contrib.revoke.backends.kvs.Revoke')
|
@ -20,7 +20,7 @@ import mock
|
||||
from keystone import config
|
||||
from keystone import exception
|
||||
from keystone import identity
|
||||
from keystone import tests
|
||||
from keystone.tests import unit as tests
|
||||
|
||||
|
||||
CONF = config.CONF
|
||||
|
@ -11,4 +11,4 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from keystone.tests.ksfixtures.cache import Cache # noqa
|
||||
from keystone.tests.unit.ksfixtures.cache import Cache # noqa
|
@ -22,7 +22,7 @@ from oslo_db.sqlalchemy import migration
|
||||
from keystone.common import sql
|
||||
from keystone.common.sql import migration_helpers
|
||||
from keystone import config
|
||||
from keystone import tests
|
||||
from keystone.tests import unit as tests
|
||||
|
||||
|
||||
CONF = config.CONF
|
||||
@ -88,7 +88,7 @@ def _load_sqlalchemy_models():
|
||||
|
||||
"""
|
||||
keystone_root = os.path.normpath(os.path.join(
|
||||
os.path.dirname(__file__), '..', '..'))
|
||||
os.path.dirname(__file__), '..', '..', '..'))
|
||||
for root, dirs, files in os.walk(keystone_root):
|
||||
# NOTE(morganfainberg): Slice the keystone_root off the root to ensure
|
||||
# we do not end up with a module name like:
|
@ -20,9 +20,9 @@ import six
|
||||
import webtest
|
||||
|
||||
from keystone.auth import controllers as auth_controllers
|
||||
from keystone import tests
|
||||
from keystone.tests import default_fixtures
|
||||
from keystone.tests.ksfixtures import database
|
||||
from keystone.tests import unit as tests
|
||||
from keystone.tests.unit import default_fixtures
|
||||
from keystone.tests.unit.ksfixtures import database
|
||||
|
||||
|
||||
class RestfulTestCase(tests.TestCase):
|
@ -19,7 +19,7 @@ from testtools import matchers
|
||||
|
||||
# NOTE(morganfainberg): import endpoint filter to populate the SQL model
|
||||
from keystone.contrib import endpoint_filter # noqa
|
||||
from keystone.tests import test_v3
|
||||
from keystone.tests.unit import test_v3
|
||||
|
||||
|
||||
class TestExtensionCase(test_v3.RestfulTestCase):
|
@ -27,9 +27,9 @@ from keystone import config
|
||||
from keystone.contrib import revoke
|
||||
from keystone import exception
|
||||
from keystone.models import token_model
|
||||
from keystone import tests
|
||||
from keystone.tests import default_fixtures
|
||||
from keystone.tests.ksfixtures import database
|
||||
from keystone.tests import unit as tests
|
||||
from keystone.tests.unit import default_fixtures
|
||||
from keystone.tests.unit.ksfixtures import database
|
||||
from keystone import token
|
||||
from keystone.token import provider
|
||||
from keystone import trust
|
@ -18,7 +18,7 @@ import mock
|
||||
|
||||
from keystone import auth
|
||||
from keystone import exception
|
||||
from keystone import tests
|
||||
from keystone.tests import unit as tests
|
||||
|
||||
|
||||
# for testing purposes only
|
||||
@ -69,7 +69,8 @@ class TestAuthPlugin(tests.SQLDriverOverrides, tests.TestCase):
|
||||
('password', 'keystone.auth.plugins.password.Password'),
|
||||
('token', 'keystone.auth.plugins.token.Token'),
|
||||
(METHOD_NAME,
|
||||
'keystone.tests.test_auth_plugin.SimpleChallengeResponse'),
|
||||
'keystone.tests.unit.test_auth_plugin.'
|
||||
'SimpleChallengeResponse'),
|
||||
])
|
||||
self.auth_plugin_config_override(
|
||||
methods=['external', 'password', 'token', METHOD_NAME],
|
||||
@ -142,15 +143,16 @@ class TestInvalidAuthMethodRegistration(tests.TestCase):
|
||||
self.config_fixture.config(
|
||||
group='auth',
|
||||
methods=[
|
||||
'keystone.tests.test_auth_plugin.SimpleChallengeResponse',
|
||||
'keystone.tests.test_auth_plugin.DuplicateAuthPlugin'])
|
||||
'keystone.tests.unit.test_auth_plugin.SimpleChallengeResponse',
|
||||
'keystone.tests.unit.test_auth_plugin.DuplicateAuthPlugin'])
|
||||
self.clear_auth_plugin_registry()
|
||||
self.assertRaises(ValueError, auth.controllers.load_auth_methods)
|
||||
|
||||
def test_no_method_attribute_auth_method_by_class_name_registration(self):
|
||||
self.config_fixture.config(
|
||||
group='auth',
|
||||
methods=['keystone.tests.test_auth_plugin.NoMethodAuthPlugin'])
|
||||
methods=['keystone.tests.unit.test_auth_plugin.NoMethodAuthPlugin']
|
||||
)
|
||||
self.clear_auth_plugin_registry()
|
||||
self.assertRaises(ValueError, auth.controllers.load_auth_methods)
|
||||
|
@ -27,10 +27,10 @@ from keystone.catalog import core
|
||||
from keystone.common import driver_hints
|
||||
from keystone import config
|
||||
from keystone import exception
|
||||
from keystone import tests
|
||||
from keystone.tests import default_fixtures
|
||||
from keystone.tests import filtering
|
||||
from keystone.tests import utils as test_utils
|
||||
from keystone.tests import unit as tests
|
||||
from keystone.tests.unit import default_fixtures
|
||||
from keystone.tests.unit import filtering
|
||||
from keystone.tests.unit import utils as test_utils
|
||||
from keystone.token import provider
|
||||
|
||||
|
@ -13,8 +13,8 @@
|
||||
# under the License.
|
||||
|
||||
from keystone.common import sql
|
||||
from keystone.tests import test_backend_endpoint_policy
|
||||
from keystone.tests import test_backend_sql
|
||||
from keystone.tests.unit import test_backend_endpoint_policy
|
||||
from keystone.tests.unit import test_backend_sql
|
||||
|
||||
|
||||
class SqlPolicyAssociationTable(test_backend_sql.SqlModels):
|
@ -13,7 +13,7 @@
|
||||
# under the License.
|
||||
|
||||
from keystone.common import sql
|
||||
from keystone.tests import test_backend_sql
|
||||
from keystone.tests.unit import test_backend_sql
|
||||
|
||||
|
||||
class SqlFederation(test_backend_sql.SqlModels):
|
@ -19,8 +19,8 @@ from testtools import matchers
|
||||
|
||||
from keystone.common import sql
|
||||
from keystone.identity.mapping_backends import mapping
|
||||
from keystone.tests import identity_mapping as mapping_sql
|
||||
from keystone.tests import test_backend_sql
|
||||
from keystone.tests.unit import identity_mapping as mapping_sql
|
||||
from keystone.tests.unit import test_backend_sql
|
||||
|
||||
|
||||
class SqlIDMappingTable(test_backend_sql.SqlModels):
|
@ -19,8 +19,8 @@ import six
|
||||
|
||||
from keystone import config
|
||||
from keystone import exception
|
||||
from keystone import tests
|
||||
from keystone.tests import test_backend
|
||||
from keystone.tests import unit as tests
|
||||
from keystone.tests.unit import test_backend
|
||||
|
||||
|
||||
CONF = config.CONF
|
@ -30,12 +30,12 @@ from keystone import exception
|
||||
from keystone import identity
|
||||
from keystone.identity.mapping_backends import mapping as map
|
||||
from keystone import resource
|
||||
from keystone import tests
|
||||
from keystone.tests import default_fixtures
|
||||
from keystone.tests import fakeldap
|
||||
from keystone.tests import identity_mapping as mapping_sql
|
||||
from keystone.tests.ksfixtures import database
|
||||
from keystone.tests import test_backend
|
||||
from keystone.tests import unit as tests
|
||||
from keystone.tests.unit import default_fixtures
|
||||
from keystone.tests.unit import fakeldap
|
||||
from keystone.tests.unit import identity_mapping as mapping_sql
|
||||
from keystone.tests.unit.ksfixtures import database
|
||||
from keystone.tests.unit import test_backend
|
||||
|
||||
|
||||
CONF = config.CONF
|
@ -21,9 +21,9 @@ from oslotest import mockpatch
|
||||
from keystone.common.ldap import core as ldap_core
|
||||
from keystone import config
|
||||
from keystone.identity.backends import ldap
|
||||
from keystone import tests
|
||||
from keystone.tests import fakeldap
|
||||
from keystone.tests import test_backend_ldap
|
||||
from keystone.tests import unit as tests
|
||||
from keystone.tests.unit import fakeldap
|
||||
from keystone.tests.unit import test_backend_ldap
|
||||
|
||||
CONF = config.CONF
|
||||
|
@ -14,8 +14,8 @@
|
||||
|
||||
|
||||
from keystone import exception
|
||||
from keystone import tests
|
||||
from keystone.tests import test_backend
|
||||
from keystone.tests import unit as tests
|
||||
from keystone.tests.unit import test_backend
|
||||
|
||||
|
||||
class RulesPolicy(tests.TestCase, test_backend.PolicyTests):
|
@ -29,10 +29,10 @@ from keystone import config
|
||||
from keystone import exception
|
||||
from keystone.identity.backends import sql as identity_sql
|
||||
from keystone.openstack.common import versionutils
|
||||
from keystone import tests
|
||||
from keystone.tests import default_fixtures
|
||||
from keystone.tests.ksfixtures import database
|
||||
from keystone.tests import test_backend
|
||||
from keystone.tests import unit as tests
|
||||
from keystone.tests.unit import default_fixtures
|
||||
from keystone.tests.unit.ksfixtures import database
|
||||
from keystone.tests.unit import test_backend
|
||||
from keystone.token.persistence.backends import sql as token_sql
|
||||
|
||||
|
@ -15,10 +15,10 @@
|
||||
import os
|
||||
import uuid
|
||||
|
||||
from keystone import tests
|
||||
from keystone.tests import default_fixtures
|
||||
from keystone.tests.ksfixtures import database
|
||||
from keystone.tests import test_backend
|
||||
from keystone.tests import unit as tests
|
||||
from keystone.tests.unit import default_fixtures
|
||||
from keystone.tests.unit.ksfixtures import database
|
||||
from keystone.tests.unit import test_backend
|
||||
|
||||
|
||||
DEFAULT_CATALOG_TEMPLATES = os.path.abspath(os.path.join(
|
@ -20,7 +20,7 @@ from dogpile.cache import proxy
|
||||
from keystone.common import cache
|
||||
from keystone import config
|
||||
from keystone import exception
|
||||
from keystone import tests
|
||||
from keystone.tests import unit as tests
|
||||
|
||||
|
||||
CONF = config.CONF
|
@ -23,7 +23,7 @@ import six
|
||||
|
||||
from keystone.common.cache.backends import mongo
|
||||
from keystone import exception
|
||||
from keystone import tests
|
||||
from keystone.tests import unit as tests
|
||||
|
||||
|
||||
# Mock database structure sample where 'ks_cache' is database and
|
@ -17,9 +17,9 @@ import uuid
|
||||
import six
|
||||
|
||||
from keystone import catalog
|
||||
from keystone import tests
|
||||
from keystone.tests.ksfixtures import database
|
||||
from keystone.tests import rest
|
||||
from keystone.tests import unit as tests
|
||||
from keystone.tests.unit.ksfixtures import database
|
||||
from keystone.tests.unit import rest
|
||||
|
||||
|
||||
BASE_URL = 'http://127.0.0.1:35357/v2'
|
@ -22,8 +22,8 @@ from testtools import matchers
|
||||
from keystone.common import environment
|
||||
from keystone.common import openssl
|
||||
from keystone import exception
|
||||
from keystone import tests
|
||||
from keystone.tests import rest
|
||||
from keystone.tests import unit as tests
|
||||
from keystone.tests.unit import rest
|
||||
from keystone import token
|
||||
|
||||
|
@ -13,8 +13,8 @@
|
||||
# under the License.
|
||||
|
||||
from keystone import cli
|
||||
from keystone import tests
|
||||
from keystone.tests.ksfixtures import database
|
||||
from keystone.tests import unit as tests
|
||||
from keystone.tests.unit.ksfixtures import database
|
||||
|
||||
|
||||
class CliTestCase(tests.SQLDriverOverrides, tests.TestCase):
|
@ -16,7 +16,7 @@ import uuid
|
||||
|
||||
from keystone import config
|
||||
from keystone import exception
|
||||
from keystone import tests
|
||||
from keystone.tests import unit as tests
|
||||
|
||||
|
||||
CONF = config.CONF
|
@ -23,7 +23,7 @@ from testtools import matchers
|
||||
from keystone.common import extension as keystone_extension
|
||||
from keystone import config
|
||||
from keystone.contrib import revoke
|
||||
from keystone.tests import rest
|
||||
from keystone.tests.unit import rest
|
||||
|
||||
|
||||
CONF = config.CONF
|
@ -16,7 +16,7 @@ import uuid
|
||||
|
||||
from keystone.contrib import s3
|
||||
from keystone import exception
|
||||
from keystone import tests
|
||||
from keystone.tests import unit as tests
|
||||
|
||||
|
||||
class S3ContribCore(tests.TestCase):
|
@ -12,7 +12,7 @@
|
||||
|
||||
import uuid
|
||||
|
||||
from keystone.tests import test_v3
|
||||
from keystone.tests.unit import test_v3
|
||||
|
||||
|
||||
class BaseTestCase(test_v3.RestfulTestCase):
|
@ -19,7 +19,7 @@ from sqlalchemy import exc
|
||||
from testtools import matchers
|
||||
|
||||
from keystone.openstack.common import log
|
||||
from keystone import tests
|
||||
from keystone.tests import unit as tests
|
||||
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
|
@ -13,7 +13,7 @@
|
||||
# under the License.
|
||||
|
||||
from keystone.common import driver_hints
|
||||
from keystone.tests import core as test
|
||||
from keystone.tests.unit import core as test
|
||||
|
||||
|
||||
class ListHintsTests(test.TestCase):
|
@ -13,7 +13,7 @@
|
||||
from keystonemiddleware import ec2_token as ksm_ec2_token
|
||||
|
||||
from keystone.middleware import ec2_token
|
||||
from keystone import tests
|
||||
from keystone.tests import unit as tests
|
||||
|
||||
|
||||
class EC2TokenMiddlewareTestBase(tests.BaseTestCase):
|
@ -19,7 +19,7 @@ import six
|
||||
|
||||
from keystone.common import wsgi
|
||||
from keystone import exception
|
||||
from keystone import tests
|
||||
from keystone.tests import unit as tests
|
||||
|
||||
|
||||
class ExceptionTestCase(tests.TestCase):
|
@ -17,7 +17,7 @@ import pep8
|
||||
import testtools
|
||||
|
||||
from keystone.hacking import checks
|
||||
from keystone.tests.ksfixtures import hacking as hacking_fixtures
|
||||
from keystone.tests.unit.ksfixtures import hacking as hacking_fixtures
|
||||
|
||||
|
||||
class BaseStyleCheck(testtools.TestCase):
|
||||
|
@ -15,8 +15,8 @@
|
||||
|
||||
from keystone.common import environment
|
||||
from keystone import config
|
||||
from keystone import tests
|
||||
from keystone.tests.ksfixtures import appserver
|
||||
from keystone.tests import unit as tests
|
||||
from keystone.tests.unit.ksfixtures import appserver
|
||||
|
||||
|
||||
CONF = config.CONF
|
@ -23,10 +23,10 @@ from oslo_utils import timeutils
|
||||
import webob
|
||||
|
||||
from keystone import config
|
||||
from keystone import tests
|
||||
from keystone.tests import default_fixtures
|
||||
from keystone.tests.ksfixtures import appserver
|
||||
from keystone.tests.ksfixtures import database
|
||||
from keystone.tests import unit as tests
|
||||
from keystone.tests.unit import default_fixtures
|
||||
from keystone.tests.unit.ksfixtures import appserver
|
||||
from keystone.tests.unit.ksfixtures import database
|
||||
|
||||
|
||||
CONF = config.CONF
|
@ -17,8 +17,8 @@ import uuid
|
||||
from keystoneclient.contrib.ec2 import utils as ec2_utils
|
||||
from keystoneclient import exceptions as client_exceptions
|
||||
|
||||
from keystone import tests
|
||||
from keystone.tests import test_keystoneclient
|
||||
from keystone.tests import unit as tests
|
||||
from keystone.tests.unit import test_keystoneclient
|
||||
|
||||
|
||||
class ClientDrivenSqlTestCase(test_keystoneclient.ClientDrivenTestCase):
|
@ -26,7 +26,7 @@ from keystone.common.kvs.backends import inmemdb
|
||||
from keystone.common.kvs.backends import memcached
|
||||
from keystone.common.kvs import core
|
||||
from keystone import exception
|
||||
from keystone import tests
|
||||
from keystone.tests import unit as tests
|
||||
|
||||
NO_VALUE = api.NO_VALUE
|
||||
|
||||
@ -189,8 +189,8 @@ class KVSTest(tests.TestCase):
|
||||
kvs = self._get_kvs_region()
|
||||
kvs.configure(
|
||||
'openstack.kvs.Memory',
|
||||
proxy_list=['keystone.tests.test_kvs.RegionProxyFixture',
|
||||
'keystone.tests.test_kvs.RegionProxy2Fixture'])
|
||||
proxy_list=['keystone.tests.unit.test_kvs.RegionProxyFixture',
|
||||
'keystone.tests.unit.test_kvs.RegionProxy2Fixture'])
|
||||
|
||||
self.assertIsInstance(kvs._region.backend, RegionProxyFixture)
|
||||
self.assertIsInstance(kvs._region.backend.proxied, RegionProxy2Fixture)
|
@ -21,8 +21,8 @@ import ldap.modlist
|
||||
from keystone import config
|
||||
from keystone import exception
|
||||
from keystone.identity.backends import ldap as identity_ldap
|
||||
from keystone import tests
|
||||
from keystone.tests import test_backend_ldap
|
||||
from keystone.tests import unit as tests
|
||||
from keystone.tests.unit import test_backend_ldap
|
||||
|
||||
|
||||
CONF = config.CONF
|
@ -19,10 +19,10 @@ import ldappool
|
||||
from keystone.common.ldap import core as ldap_core
|
||||
from keystone import config
|
||||
from keystone.identity.backends import ldap
|
||||
from keystone import tests
|
||||
from keystone.tests import fakeldap
|
||||
from keystone.tests import test_backend_ldap_pool
|
||||
from keystone.tests import test_ldap_livetest
|
||||
from keystone.tests import unit as tests
|
||||
from keystone.tests.unit import fakeldap
|
||||
from keystone.tests.unit import test_backend_ldap_pool
|
||||
from keystone.tests.unit import test_ldap_livetest
|
||||
|
||||
|
||||
CONF = config.CONF
|
@ -19,8 +19,8 @@ import ldap.modlist
|
||||
from keystone import config
|
||||
from keystone import exception
|
||||
from keystone import identity
|
||||
from keystone import tests
|
||||
from keystone.tests import test_ldap_livetest
|
||||
from keystone.tests import unit as tests
|
||||
from keystone.tests.unit import test_ldap_livetest
|
||||
|
||||
|
||||
CONF = config.CONF
|
@ -16,7 +16,7 @@ import webob
|
||||
|
||||
from keystone import config
|
||||
from keystone import middleware
|
||||
from keystone import tests
|
||||
from keystone.tests import unit as tests
|
||||
|
||||
|
||||
CONF = config.CONF
|
@ -16,7 +16,7 @@ import os
|
||||
|
||||
import webtest
|
||||
|
||||
from keystone import tests
|
||||
from keystone.tests import unit as tests
|
||||
|
||||
|
||||
class TestNoAdminTokenAuth(tests.TestCase):
|
@ -23,8 +23,8 @@ from testtools import matchers
|
||||
from keystone import exception
|
||||
from keystone.openstack.common import policy as common_policy
|
||||
from keystone.policy.backends import rules
|
||||
from keystone import tests
|
||||
from keystone.tests.ksfixtures import temporaryfile
|
||||
from keystone.tests import unit as tests
|
||||
from keystone.tests.unit.ksfixtures import temporaryfile
|
||||
|
||||
|
||||
class PolicyFileTestCase(tests.TestCase):
|
@ -21,8 +21,8 @@ from testtools import matchers
|
||||
from keystone.contrib import revoke
|
||||
from keystone.contrib.revoke import model
|
||||
from keystone import exception
|
||||
from keystone import tests
|
||||
from keystone.tests import test_backend_sql
|
||||
from keystone.tests import unit as tests
|
||||
from keystone.tests.unit import test_backend_sql
|
||||
from keystone.token import provider
|
||||
|
||||
|
@ -12,9 +12,9 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from keystone import tests
|
||||
from keystone.tests import test_sql_migrate_extensions
|
||||
from keystone.tests import test_sql_upgrade
|
||||
from keystone.tests import unit as tests
|
||||
from keystone.tests.unit import test_sql_migrate_extensions
|
||||
from keystone.tests.unit import test_sql_upgrade
|
||||
|
||||
|
||||
class PostgresqlMigrateTests(test_sql_upgrade.SqlUpgradeTests):
|
@ -14,12 +14,12 @@
|
||||
"""
|
||||
To run these tests against a live database:
|
||||
|
||||
1. Modify the file `keystone/tests/config_files/backend_sql.conf` to use
|
||||
1. Modify the file `keystone/tests/unit/config_files/backend_sql.conf` to use
|
||||
the connection for your live database.
|
||||
2. Set up a blank, live database.
|
||||
3. Run the tests using::
|
||||
|
||||
tox -e py27 -- keystone.tests.test_sql_migrate_extensions
|
||||
tox -e py27 -- keystone.tests.unit.test_sql_migrate_extensions
|
||||
|
||||
WARNING::
|
||||
|
||||
@ -37,7 +37,7 @@ from keystone.contrib import example
|
||||
from keystone.contrib import federation
|
||||
from keystone.contrib import oauth1
|
||||
from keystone.contrib import revoke
|
||||
from keystone.tests import test_sql_upgrade
|
||||
from keystone.tests.unit import test_sql_upgrade
|
||||
|
||||
|
||||
class SqlUpgradeExampleExtension(test_sql_upgrade.SqlMigrateBase):
|
@ -14,12 +14,12 @@
|
||||
"""
|
||||
To run these tests against a live database:
|
||||
|
||||
1. Modify the file ``keystone/tests/config_files/backend_sql.conf`` to use
|
||||
1. Modify the file ``keystone/tests/unit/config_files/backend_sql.conf`` to use
|
||||
the connection for your live database.
|
||||
2. Set up a blank, live database
|
||||
3. Run the tests using::
|
||||
|
||||
tox -e py27 -- keystone.tests.test_sql_upgrade
|
||||
tox -e py27 -- keystone.tests.unit.test_sql_upgrade
|
||||
|
||||
WARNING::
|
||||
|
||||
@ -50,9 +50,9 @@ from keystone import config
|
||||
from keystone.contrib import federation
|
||||
from keystone.contrib import revoke
|
||||
from keystone import exception
|
||||
from keystone import tests
|
||||
from keystone.tests import default_fixtures
|
||||
from keystone.tests.ksfixtures import database
|
||||
from keystone.tests import unit as tests
|
||||
from keystone.tests.unit import default_fixtures
|
||||
from keystone.tests.unit.ksfixtures import database
|
||||
|
||||
|
||||
CONF = config.CONF
|
@ -18,8 +18,8 @@ import ssl
|
||||
|
||||
from keystone.common import environment
|
||||
from keystone import config
|
||||
from keystone import tests
|
||||
from keystone.tests.ksfixtures import appserver
|
||||
from keystone.tests import unit as tests
|
||||
from keystone.tests.unit.ksfixtures import appserver
|
||||
|
||||
|
||||
CONF = config.CONF
|
@ -18,8 +18,8 @@ import uuid
|
||||
from keystone.common import wsgi
|
||||
from keystone import exception
|
||||
from keystone.models import token_model
|
||||
from keystone import tests
|
||||
from keystone.tests import test_token_provider
|
||||
from keystone.tests import unit as tests
|
||||
from keystone.tests.unit import test_token_provider
|
||||
|
||||
|
||||
KERBEROS_BIND = 'USER@REALM'
|
@ -18,9 +18,9 @@ from oslo_utils import timeutils
|
||||
|
||||
from keystone import config
|
||||
from keystone import exception
|
||||
from keystone import tests
|
||||
from keystone.tests import default_fixtures
|
||||
from keystone.tests.ksfixtures import database
|
||||
from keystone.tests import unit as tests
|
||||
from keystone.tests.unit import default_fixtures
|
||||
from keystone.tests.unit.ksfixtures import database
|
||||
from keystone import token
|
||||
from keystone.token.providers import pki
|
||||
|
@ -15,7 +15,7 @@
|
||||
import webob
|
||||
|
||||
from keystone import middleware
|
||||
from keystone import tests
|
||||
from keystone.tests import unit as tests
|
||||
|
||||
|
||||
class FakeApp(object):
|
@ -17,9 +17,9 @@ import uuid
|
||||
|
||||
from keystone.assignment import controllers as assignment_controllers
|
||||
from keystone.resource import controllers as resource_controllers
|
||||
from keystone import tests
|
||||
from keystone.tests import default_fixtures
|
||||
from keystone.tests.ksfixtures import database
|
||||
from keystone.tests import unit as tests
|
||||
from keystone.tests.unit import default_fixtures
|
||||
from keystone.tests.unit.ksfixtures import database
|
||||
|
||||
|
||||
_ADMIN_CONTEXT = {'is_admin': True, 'query_string': {}}
|