Split assignment backend tests

Where to put a new test ? Is this behavior covered yet ? These and
other questions require understanding the test coverage to be answered.

test_backend.py is a huge test file, making it hard to understand what
cases are currently covered for each backend.

This chain of changes proposes to split it by the backends it covers;
the tests will be placed into 'unit/{backend}/test_backends.py'.

This change splits the tests for the assignment backend.

Change-Id: I43ecea73d8c4ee70dd861d010282affb2ec3232a
This commit is contained in:
Samuel de Medeiros Queiroz 2016-03-04 12:43:48 -03:00
parent e2ee064192
commit bcf13b5daa
5 changed files with 3724 additions and 3686 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -36,6 +36,7 @@ from keystone import identity
from keystone.identity.mapping_backends import mapping as map
from keystone import resource
from keystone.tests import unit
from keystone.tests.unit.assignment import test_backends as assignment_tests
from keystone.tests.unit import default_fixtures
from keystone.tests.unit import identity_mapping as mapping_sql
from keystone.tests.unit.ksfixtures import database
@ -120,7 +121,8 @@ def create_group_container(identity_api):
('ou', ['Groups'])])
class BaseLDAPIdentity(test_backend.IdentityTests):
class BaseLDAPIdentity(test_backend.IdentityTests,
assignment_tests.AssignmentTests):
def setUp(self):
super(BaseLDAPIdentity, self).setUp()
@ -1660,9 +1662,9 @@ class LDAPIdentity(BaseLDAPIdentity, unit.TestCase):
def test_multi_role_grant_by_user_group_on_project_domain(self):
# This is a partial implementation of the standard test that
# is defined in test_backend.py. It omits both domain and
# group grants. since neither of these are yet supported by
# the ldap backend.
# is defined in unit.assignment.test_backends.py. It omits
# both domain and group grants. since neither of these are
# yet supported by the ldap backend.
role_list = []
for _ in range(2):

View File

@ -31,6 +31,7 @@ from keystone import exception
from keystone.identity.backends import sql as identity_sql
from keystone import resource
from keystone.tests import unit
from keystone.tests.unit.assignment import test_backends as assignment_tests
from keystone.tests.unit import default_fixtures
from keystone.tests.unit.ksfixtures import database
from keystone.tests.unit import test_backend
@ -191,7 +192,8 @@ class SqlModels(SqlTests):
self.assertExpectedSchema('user_group_membership', cols)
class SqlIdentity(SqlTests, test_backend.IdentityTests):
class SqlIdentity(SqlTests, test_backend.IdentityTests,
assignment_tests.AssignmentTests):
def test_password_hashed(self):
with sql.session_for_read() as session:
user_ref = self.identity_api._get_user(session,
@ -814,11 +816,11 @@ class SqlPolicy(SqlTests, test_backend.PolicyTests):
pass
class SqlInheritance(SqlTests, test_backend.InheritanceTests):
class SqlInheritance(SqlTests, assignment_tests.InheritanceTests):
pass
class SqlImpliedRoles(SqlTests, test_backend.ImpliedRoleTests):
class SqlImpliedRoles(SqlTests, assignment_tests.ImpliedRoleTests):
pass