aboutsummaryrefslogtreecommitdiff
path: root/tests/unit/auth/test_roles.py
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2023-08-23 09:12:07 +0300
committerFrederick Muriuki Muriithi2023-08-23 09:13:02 +0300
commit8d35e0413fa670ef4fc08e7262a12c43b89df6fc (patch)
treedd6bbc1f13a5a241f28f8507a659de1d3474af24 /tests/unit/auth/test_roles.py
parent277297d9a804e09137493bd9e1613df94f154dc0 (diff)
downloadgn-auth-8d35e0413fa670ef4fc08e7262a12c43b89df6fc.tar.gz
pylint: Replace `lambda ...` statements with `def ...`
Diffstat (limited to 'tests/unit/auth/test_roles.py')
-rw-r--r--tests/unit/auth/test_roles.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/unit/auth/test_roles.py b/tests/unit/auth/test_roles.py
index 67654d8..227cb9e 100644
--- a/tests/unit/auth/test_roles.py
+++ b/tests/unit/auth/test_roles.py
@@ -16,8 +16,6 @@ create_role_failure = {
"message": "Unauthorised: Could not create role"
}
-uuid_fn = lambda : uuid.UUID("d32611e3-07fc-4564-b56c-786c6db6de2b")
-
PRIVILEGES = (
Privilege("group:resource:view-resource",
"view a resource and use it in computations"),
@@ -36,7 +34,7 @@ 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("gn_auth.auth.authorisation.roles.models.uuid4", uuid_fn)
+ mocker.patch("gn_auth.auth.authorisation.roles.models.uuid4", conftest.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:
@@ -55,7 +53,7 @@ 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("gn_auth.auth.authorisation.roles.models.uuid4", uuid_fn)
+ mocker.patch("gn_auth.auth.authorisation.roles.models.uuid4", conftest.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: