|
@ -3,16 +3,18 @@ from corvus.service.role_service import ROLES, Role |
|
|
|
|
|
|
|
|
def test_role_tree_find_roles_in_hierarchy(): |
|
|
def test_role_tree_find_roles_in_hierarchy(): |
|
|
roles = ROLES.find_roles_in_hierarchy(Role.USER) |
|
|
roles = ROLES.find_roles_in_hierarchy(Role.USER) |
|
|
assert len(roles) == 4 |
|
|
|
|
|
|
|
|
assert len(roles) == 5 |
|
|
assert Role.USER in roles |
|
|
assert Role.USER in roles |
|
|
assert Role.MODERATOR in roles |
|
|
assert Role.MODERATOR in roles |
|
|
assert Role.AUDITOR in roles |
|
|
assert Role.AUDITOR in roles |
|
|
assert Role.ADMIN in roles |
|
|
assert Role.ADMIN in roles |
|
|
|
|
|
assert Role.OWNER in roles |
|
|
|
|
|
|
|
|
roles = ROLES.find_roles_in_hierarchy(Role.AUDITOR) |
|
|
roles = ROLES.find_roles_in_hierarchy(Role.AUDITOR) |
|
|
assert len(roles) == 2 |
|
|
|
|
|
|
|
|
assert len(roles) == 3 |
|
|
assert Role.AUDITOR in roles |
|
|
assert Role.AUDITOR in roles |
|
|
assert Role.ADMIN in roles |
|
|
assert Role.ADMIN in roles |
|
|
|
|
|
assert Role.OWNER in roles |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_role_tree_find_children_roles(): |
|
|
def test_role_tree_find_children_roles(): |
|
|