From c9f35e54d5d894051ceb446d1dce54915dcb20f6 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 7 Aug 2023 07:19:16 +0300 Subject: Update module name/path Change from gn3 to gn_auth --- tests/unit/auth/test_roles.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'tests/unit/auth/test_roles.py') 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): -- cgit v1.2.3