aboutsummaryrefslogtreecommitdiff
path: root/tests/unit/auth/test_resources.py
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2023-02-02 11:35:51 +0300
committerFrederick Muriuki Muriithi2023-02-02 12:03:51 +0300
commitdfe5eb18e3ec8dc570d118bfe95c5d4dcb2c7575 (patch)
treeb45da1e9eba405042ef47174215b827739f5a393 /tests/unit/auth/test_resources.py
parent6fc120aca6062f96725adaece85a7b76000affda (diff)
downloadgenenetwork3-dfe5eb18e3ec8dc570d118bfe95c5d4dcb2c7575.tar.gz
auth: Reorganise modules/packages for easier dev and maintenance
Split the views/routes into separate modules each dealing with a narrower scope of the application to aid in maintenance, and help with making the development easier.
Diffstat (limited to 'tests/unit/auth/test_resources.py')
-rw-r--r--tests/unit/auth/test_resources.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/unit/auth/test_resources.py b/tests/unit/auth/test_resources.py
index a0236c4..a360442 100644
--- a/tests/unit/auth/test_resources.py
+++ b/tests/unit/auth/test_resources.py
@@ -6,7 +6,7 @@ import pytest
from gn3.auth import db
from gn3.auth.authorisation.groups import Group
from gn3.auth.authorisation.errors import AuthorisationError
-from gn3.auth.authorisation.resources import (
+from gn3.auth.authorisation.resources.models import (
Resource, user_resources, create_resource, ResourceCategory,
public_resources)
@@ -32,7 +32,7 @@ uuid_fn = lambda : uuid.UUID("d32611e3-07fc-4564-b56c-786c6db6de2b")
"test_resource", resource_category, False),))))
def test_create_resource(mocker, fxtr_app, fxtr_users_in_group, user, expected):
"""Test that resource creation works as expected."""
- mocker.patch("gn3.auth.authorisation.resources.uuid4", uuid_fn)
+ mocker.patch("gn3.auth.authorisation.resources.models.uuid4", uuid_fn)
conn, _group, _users = fxtr_users_in_group
with fxtr_app.app_context() as flask_context, db.cursor(conn) as cursor:
flask_context.g.user = user
@@ -52,7 +52,7 @@ def test_create_resource(mocker, fxtr_app, fxtr_users_in_group, user, expected):
def test_create_resource_raises_for_unauthorised_users(
mocker, fxtr_app, fxtr_users_in_group, user, expected):
"""Test that resource creation works as expected."""
- mocker.patch("gn3.auth.authorisation.resources.uuid4", uuid_fn)
+ mocker.patch("gn3.auth.authorisation.resources.models.uuid4", uuid_fn)
conn, _group, _users = fxtr_users_in_group
with fxtr_app.app_context() as flask_context:
flask_context.g.user = user