An ebook/comic library service and web client
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

  1. from atheneum.service.role_service import ROLES, Role
  2. def test_role_tree_find_roles_in_hierarchy():
  3. roles = ROLES.find_roles_in_hierarchy(Role.USER)
  4. assert len(roles) == 4
  5. assert Role.USER in roles
  6. assert Role.MODERATOR in roles
  7. assert Role.AUDITOR in roles
  8. assert Role.ADMIN in roles
  9. roles = ROLES.find_roles_in_hierarchy(Role.AUDITOR)
  10. assert len(roles) == 2
  11. assert Role.AUDITOR in roles
  12. assert Role.ADMIN in roles
  13. def test_role_tree_find_role_key_error():
  14. assert len(ROLES.find_role(Role.NONE)) == 0