diff options
author | Frederick Muriuki Muriithi | 2023-08-23 09:12:07 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2023-08-23 09:13:02 +0300 |
commit | 8d35e0413fa670ef4fc08e7262a12c43b89df6fc (patch) | |
tree | dd6bbc1f13a5a241f28f8507a659de1d3474af24 /tests/unit/auth/test_privileges.py | |
parent | 277297d9a804e09137493bd9e1613df94f154dc0 (diff) | |
download | gn-auth-8d35e0413fa670ef4fc08e7262a12c43b89df6fc.tar.gz |
pylint: Replace `lambda ...` statements with `def ...`
Diffstat (limited to 'tests/unit/auth/test_privileges.py')
-rw-r--r-- | tests/unit/auth/test_privileges.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/unit/auth/test_privileges.py b/tests/unit/auth/test_privileges.py index b37a1a7..0b5f120 100644 --- a/tests/unit/auth/test_privileges.py +++ b/tests/unit/auth/test_privileges.py @@ -6,7 +6,9 @@ from gn_auth.auth.authorisation.privileges import Privilege, user_privileges from tests.unit.auth import conftest -SORT_KEY = lambda x: x.privilege_id +def sort_key_privileges(priv): + """Sort-key for privileges.""" + return priv.privilege_id PRIVILEGES = sorted( (Privilege("system:group:create-group", "Create a group"), @@ -29,7 +31,7 @@ PRIVILEGES = sorted( Privilege("group:role:edit-role", "edit/update an existing role"), Privilege("group:user:assign-role", "Assign a role to an existing user"), Privilege("group:role:delete-role", "Delete an existing role")), - key=SORT_KEY) + key=sort_key_privileges) @pytest.mark.unit_test @pytest.mark.parametrize( @@ -43,4 +45,4 @@ def test_user_privileges(auth_testdb_path, fxtr_users, user, expected):# pylint: """ with db.connection(auth_testdb_path) as conn: assert sorted( - user_privileges(conn, user), key=SORT_KEY) == expected + user_privileges(conn, user), key=sort_key_privileges) == expected |