Browse Source

fix: lint test fix

pull/566/head
David 11 months ago
parent
commit
7e13b682d9
  1. 4
      src/keycloak/keycloak_admin.py
  2. 10
      tests/test_keycloak_admin.py
  3. 2
      tests/test_keycloak_openid.py
  4. 2
      tests/test_keycloak_uma.py

4
src/keycloak/keycloak_admin.py

@ -4719,7 +4719,9 @@ class KeycloakAdmin:
:return: UserRepresentation
"""
params_path = {"realm-name": self.connection.realm_name, "id": user_id}
data_raw = await self.connection.a_raw_get(urls_patterns.URL_ADMIN_USER.format(**params_path))
data_raw = await self.connection.a_raw_get(
urls_patterns.URL_ADMIN_USER.format(**params_path)
)
return raise_error_from_response(data_raw, KeycloakGetError)
async def a_get_user_groups(self, user_id, query=None, brief_representation=True):

10
tests/test_keycloak_admin.py

@ -3066,6 +3066,7 @@ def test_refresh_token(admin: KeycloakAdmin):
# async function start
@pytest.mark.asyncio
async def test_a_realms(admin: KeycloakAdmin):
"""Test realms.
@ -3456,7 +3457,9 @@ async def test_a_user_groups_pagination(admin: KeycloakAdmin, realm: str):
groups = await admin.a_get_user_groups(user_id=user_id)
assert len(groups) == admin.PAGE_SIZE + 50, len(groups)
groups = await admin.a_get_user_groups(user_id=user_id, query={"first": 100, "max": -1, "search": ""})
groups = await admin.a_get_user_groups(
user_id=user_id, query={"first": 100, "max": -1, "search": ""}
)
assert len(groups) == 50, len(groups)
groups = await admin.a_get_user_groups(
@ -5439,10 +5442,9 @@ async def test_a_client_scopes(admin: KeycloakAdmin, realm: str):
client_scope_id=res, protocol_mapper_id=test_mapper["id"], payload=test_mapper
)
assert res_update == dict()
assert ((await admin.a_get_mappers_from_client_scope(client_scope_id=res))[0]["config"][
assert (await admin.a_get_mappers_from_client_scope(client_scope_id=res))[0]["config"][
"user.attribute"
] == "test"
)
# Test delete mapper
res_del = await admin.a_delete_mapper_from_client_scope(
@ -5575,7 +5577,7 @@ async def test_a_keys(admin: KeycloakAdmin, realm: str):
"AES",
"HS256",
"RS256",
"RSA-OAEP"
"RSA-OAEP",
} or set((await admin.a_get_keys())["active"].keys()) == {"RSA-OAEP", "RS256", "HS512", "AES"}
assert {k["algorithm"] for k in (await admin.a_get_keys())["keys"]} == {
"HS256",

2
tests/test_keycloak_openid.py

@ -488,8 +488,10 @@ def test_device(oid_with_credentials_device: Tuple[KeycloakOpenID, str, str]):
"interval": 5,
}
# async function start
@pytest.mark.asyncio
async def test_a_well_known(oid: KeycloakOpenID):
"""Test the well_known method.

2
tests/test_keycloak_uma.py

@ -311,8 +311,10 @@ def test_uma_permission_ticket(uma: KeycloakUMA):
uma.resource_set_delete(resource["_id"])
# async function start
@pytest.mark.asyncio
async def test_a_uma_well_known(uma: KeycloakUMA):
"""Test the well_known method.

Loading…
Cancel
Save