diff options
author | Frederick Muriuki Muriithi | 2023-08-07 07:19:16 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2023-08-07 09:26:11 +0300 |
commit | c9f35e54d5d894051ceb446d1dce54915dcb20f6 (patch) | |
tree | c2bfc7bd6b7feab4b7418770f05e7d6ab43623da /tests/unit/auth/test_roles.py | |
parent | b7f5cd0d788748559ca5e9768f3ea35d45442ef6 (diff) | |
download | gn-auth-c9f35e54d5d894051ceb446d1dce54915dcb20f6.tar.gz |
Update module name/path
Change from gn3 to gn_auth
Diffstat (limited to 'tests/unit/auth/test_roles.py')
-rw-r--r-- | tests/unit/auth/test_roles.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/unit/auth/test_roles.py b/tests/unit/auth/test_roles.py index 02fd9f7..31d5e8e 100644 --- a/tests/unit/auth/test_roles.py +++ b/tests/unit/auth/test_roles.py @@ -3,10 +3,10 @@ import uuid import pytest -from gn3.auth import db -from gn3.auth.authorisation.privileges import Privilege -from gn3.auth.authorisation.errors import AuthorisationError -from gn3.auth.authorisation.roles.models import Role, user_roles, create_role +from gn_auth.auth import db +from gn_auth.auth.authorisation.privileges import Privilege +from gn_auth.auth.authorisation.errors import AuthorisationError +from gn_auth.auth.authorisation.roles.models import Role, user_roles, create_role from tests.unit.auth import conftest from tests.unit.auth.fixtures import TEST_USERS @@ -36,8 +36,8 @@ def test_create_role(# pylint: disable=[too-many-arguments] THEN: verify they are only able to create the role if they have the appropriate privileges """ - mocker.patch("gn3.auth.authorisation.roles.models.uuid4", uuid_fn) - mocker.patch("gn3.auth.authorisation.checks.require_oauth.acquire", + mocker.patch("gn_auth.auth.authorisation.roles.models.uuid4", uuid_fn) + mocker.patch("gn_auth.auth.authorisation.checks.require_oauth.acquire", conftest.get_tokeniser(user)) with db.connection(auth_testdb_path) as conn, db.cursor(conn) as cursor: the_role = create_role(cursor, "a_test_role", PRIVILEGES) @@ -55,8 +55,8 @@ def test_create_role_raises_exception_for_unauthorised_users(# pylint: disable=[ THEN: verify they are only able to create the role if they have the appropriate privileges """ - mocker.patch("gn3.auth.authorisation.roles.models.uuid4", uuid_fn) - mocker.patch("gn3.auth.authorisation.checks.require_oauth.acquire", + mocker.patch("gn_auth.auth.authorisation.roles.models.uuid4", uuid_fn) + mocker.patch("gn_auth.auth.authorisation.checks.require_oauth.acquire", conftest.get_tokeniser(user)) with db.connection(auth_testdb_path) as conn, db.cursor(conn) as cursor: with pytest.raises(AuthorisationError): |