Merge "Tests use common base class"
This commit is contained in:
commit
7121d50627
|
@ -11,16 +11,16 @@
|
|||
# under the License.
|
||||
|
||||
from oslo_config import cfg
|
||||
import testtools
|
||||
|
||||
from keystone.catalog import core
|
||||
from keystone import exception
|
||||
from keystone.tests import unit
|
||||
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
||||
|
||||
class FormatUrlTests(testtools.TestCase):
|
||||
class FormatUrlTests(unit.BaseTestCase):
|
||||
|
||||
def test_successful_formatting(self):
|
||||
url_template = ('http://$(public_bind_host)s:$(admin_port)d/'
|
||||
|
|
|
@ -23,10 +23,10 @@ from pycadf import cadftaxonomy
|
|||
from pycadf import cadftype
|
||||
from pycadf import eventfactory
|
||||
from pycadf import resource as cadfresource
|
||||
import testtools
|
||||
|
||||
from keystone.common import dependency
|
||||
from keystone import notifications
|
||||
from keystone.tests import unit
|
||||
from keystone.tests.unit import test_v3
|
||||
|
||||
|
||||
|
@ -53,7 +53,7 @@ def register_callback(operation, resource_type=EXP_RESOURCE_TYPE):
|
|||
return callback
|
||||
|
||||
|
||||
class AuditNotificationsTestCase(testtools.TestCase):
|
||||
class AuditNotificationsTestCase(unit.BaseTestCase):
|
||||
def setUp(self):
|
||||
super(AuditNotificationsTestCase, self).setUp()
|
||||
self.config_fixture = self.useFixture(config_fixture.Config(CONF))
|
||||
|
@ -96,7 +96,7 @@ class AuditNotificationsTestCase(testtools.TestCase):
|
|||
DISABLED_OPERATION)
|
||||
|
||||
|
||||
class NotificationsWrapperTestCase(testtools.TestCase):
|
||||
class NotificationsWrapperTestCase(unit.BaseTestCase):
|
||||
def create_fake_ref(self):
|
||||
resource_id = uuid.uuid4().hex
|
||||
return resource_id, {
|
||||
|
@ -174,7 +174,7 @@ class NotificationsWrapperTestCase(testtools.TestCase):
|
|||
self.assertFalse(callback.called)
|
||||
|
||||
|
||||
class NotificationsTestCase(testtools.TestCase):
|
||||
class NotificationsTestCase(unit.BaseTestCase):
|
||||
def setUp(self):
|
||||
super(NotificationsTestCase, self).setUp()
|
||||
|
||||
|
@ -922,7 +922,7 @@ class CadfNotificationsWrapperTestCase(test_v3.RestfulTestCase):
|
|||
user=self.user_id)
|
||||
|
||||
|
||||
class TestCallbackRegistration(testtools.TestCase):
|
||||
class TestCallbackRegistration(unit.BaseTestCase):
|
||||
def setUp(self):
|
||||
super(TestCallbackRegistration, self).setUp()
|
||||
self.mock_log = mock.Mock()
|
||||
|
|
|
@ -14,13 +14,13 @@ import textwrap
|
|||
|
||||
import mock
|
||||
import pep8
|
||||
import testtools
|
||||
|
||||
from keystone.hacking import checks
|
||||
from keystone.tests import unit
|
||||
from keystone.tests.unit.ksfixtures import hacking as hacking_fixtures
|
||||
|
||||
|
||||
class BaseStyleCheck(testtools.TestCase):
|
||||
class BaseStyleCheck(unit.BaseTestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(BaseStyleCheck, self).setUp()
|
||||
|
|
|
@ -13,8 +13,6 @@
|
|||
|
||||
import uuid
|
||||
|
||||
import testtools
|
||||
|
||||
from keystone.assignment import schema as assignment_schema
|
||||
from keystone.catalog import schema as catalog_schema
|
||||
from keystone.common import validation
|
||||
|
@ -26,6 +24,7 @@ from keystone.credential import schema as credential_schema
|
|||
from keystone import exception
|
||||
from keystone.policy import schema as policy_schema
|
||||
from keystone.resource import schema as resource_schema
|
||||
from keystone.tests import unit
|
||||
from keystone.trust import schema as trust_schema
|
||||
|
||||
"""Example model to validate create requests against. Assume that this is
|
||||
|
@ -96,7 +95,7 @@ _VALID_FILTERS = [{'interface': 'admin'},
|
|||
_INVALID_FILTERS = ['some string', 1, 0, True, False]
|
||||
|
||||
|
||||
class EntityValidationTestCase(testtools.TestCase):
|
||||
class EntityValidationTestCase(unit.BaseTestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(EntityValidationTestCase, self).setUp()
|
||||
|
@ -299,7 +298,7 @@ class EntityValidationTestCase(testtools.TestCase):
|
|||
request_to_validate)
|
||||
|
||||
|
||||
class ProjectValidationTestCase(testtools.TestCase):
|
||||
class ProjectValidationTestCase(unit.BaseTestCase):
|
||||
"""Test for V3 Project API validation."""
|
||||
|
||||
def setUp(self):
|
||||
|
@ -426,7 +425,7 @@ class ProjectValidationTestCase(testtools.TestCase):
|
|||
request_to_validate)
|
||||
|
||||
|
||||
class DomainValidationTestCase(testtools.TestCase):
|
||||
class DomainValidationTestCase(unit.BaseTestCase):
|
||||
"""Test for V3 Domain API validation."""
|
||||
|
||||
def setUp(self):
|
||||
|
@ -524,7 +523,7 @@ class DomainValidationTestCase(testtools.TestCase):
|
|||
request_to_validate)
|
||||
|
||||
|
||||
class RoleValidationTestCase(testtools.TestCase):
|
||||
class RoleValidationTestCase(unit.BaseTestCase):
|
||||
"""Test for V3 Role API validation."""
|
||||
|
||||
def setUp(self):
|
||||
|
@ -578,7 +577,7 @@ class RoleValidationTestCase(testtools.TestCase):
|
|||
request_to_validate)
|
||||
|
||||
|
||||
class PolicyValidationTestCase(testtools.TestCase):
|
||||
class PolicyValidationTestCase(unit.BaseTestCase):
|
||||
"""Test for V3 Policy API validation."""
|
||||
|
||||
def setUp(self):
|
||||
|
@ -653,7 +652,7 @@ class PolicyValidationTestCase(testtools.TestCase):
|
|||
request_to_validate)
|
||||
|
||||
|
||||
class CredentialValidationTestCase(testtools.TestCase):
|
||||
class CredentialValidationTestCase(unit.BaseTestCase):
|
||||
"""Test for V3 Credential API validation."""
|
||||
|
||||
def setUp(self):
|
||||
|
@ -770,7 +769,7 @@ class CredentialValidationTestCase(testtools.TestCase):
|
|||
self.update_credential_validator.validate(request_to_validate)
|
||||
|
||||
|
||||
class RegionValidationTestCase(testtools.TestCase):
|
||||
class RegionValidationTestCase(unit.BaseTestCase):
|
||||
"""Test for V3 Region API validation."""
|
||||
|
||||
def setUp(self):
|
||||
|
@ -830,7 +829,7 @@ class RegionValidationTestCase(testtools.TestCase):
|
|||
request_to_validate)
|
||||
|
||||
|
||||
class ServiceValidationTestCase(testtools.TestCase):
|
||||
class ServiceValidationTestCase(unit.BaseTestCase):
|
||||
"""Test for V3 Service API validation."""
|
||||
|
||||
def setUp(self):
|
||||
|
@ -985,7 +984,7 @@ class ServiceValidationTestCase(testtools.TestCase):
|
|||
request_to_validate)
|
||||
|
||||
|
||||
class EndpointValidationTestCase(testtools.TestCase):
|
||||
class EndpointValidationTestCase(unit.BaseTestCase):
|
||||
"""Test for V3 Endpoint API validation."""
|
||||
|
||||
def setUp(self):
|
||||
|
@ -1164,7 +1163,7 @@ class EndpointValidationTestCase(testtools.TestCase):
|
|||
request_to_validate)
|
||||
|
||||
|
||||
class EndpointGroupValidationTestCase(testtools.TestCase):
|
||||
class EndpointGroupValidationTestCase(unit.BaseTestCase):
|
||||
"""Test for V3 Endpoint Group API validation."""
|
||||
|
||||
def setUp(self):
|
||||
|
@ -1269,7 +1268,7 @@ class EndpointGroupValidationTestCase(testtools.TestCase):
|
|||
request_to_validate)
|
||||
|
||||
|
||||
class TrustValidationTestCase(testtools.TestCase):
|
||||
class TrustValidationTestCase(unit.BaseTestCase):
|
||||
"""Test for V3 Trust API validation."""
|
||||
|
||||
_valid_roles = ['member', uuid.uuid4().hex, str(uuid.uuid4())]
|
||||
|
@ -1406,7 +1405,7 @@ class TrustValidationTestCase(testtools.TestCase):
|
|||
self.create_trust_validator.validate(request_to_validate)
|
||||
|
||||
|
||||
class ServiceProviderValidationTestCase(testtools.TestCase):
|
||||
class ServiceProviderValidationTestCase(unit.BaseTestCase):
|
||||
"""Test for V3 Service Provider API validation."""
|
||||
|
||||
def setUp(self):
|
||||
|
|
Loading…
Reference in New Issue