You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
551 B
19 lines
551 B
from atheneum.service.role_service import ROLES, Role
|
|
|
|
|
|
def test_role_tree_find_roles_in_hierarchy():
|
|
roles = ROLES.find_roles_in_hierarchy(Role.USER)
|
|
assert len(roles) == 4
|
|
assert Role.USER in roles
|
|
assert Role.MODERATOR in roles
|
|
assert Role.AUDITOR in roles
|
|
assert Role.ADMIN in roles
|
|
|
|
roles = ROLES.find_roles_in_hierarchy(Role.AUDITOR)
|
|
assert len(roles) == 2
|
|
assert Role.AUDITOR in roles
|
|
assert Role.ADMIN in roles
|
|
|
|
|
|
def test_role_tree_find_role_key_error():
|
|
assert len(ROLES.find_role(Role.NONE)) == 0
|